ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Accessing to Autoware_msgs/Vehicle_Status

asked 2020-09-21 09:36:12 -0500

BBlumhofe gravatar image

Hello,

I am using Autoware.ai at the moment and I am trying to use the VehicleStatus Message from the Autoware_msgs. I want to send breakpedal, drivepedal and steering angle state via UDP to another computer. For that i wrote a Python script. I am using Ros-melodic on an Ubuntu 18.04 system. My Code:

    #!/usr/bin/env python

import rospy
import socket
import sys
import time
import struct


from nav_msgs.msg import Odometry
from autoware_msgs import VehicleStatus



def VehicleStatusCb(msg):
    values = (msg.drivepedal)
    rospy.loginfo(values)


if __name__ == "__main__":
    rospy.init_node('VVehicleStatus', anonymous=True) #make node 
    rospy.Subscriber('vehicle_status',VehicleStatus,VehicleStatusCb)
    rospy.spin()

when trying to launch the script with with rosrun i receive the following error:

Traceback (most recent call last):
  File "/home/ad-ros/catkin_ws/src/beginner_tutorials/scripts/listener.py", line 11, in <module>
    from autoware_msgs import VehicleStatus
ImportError: cannot import name VehicleStatus

I think I installed the autoware_msgs correctly because with

rosmsg info

I can see the autoware messages and during built autoware_msgs_generate_py is executed. In fact that is my first post on the forum I hopefully gave all the information you need if not please tell me what is needed in addition.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2020-09-21 12:49:28 -0500

gvdhoorn gravatar image

It's most likely from autoware_msgs.msg, instead of from autoware_msgs.

Similar to from nav_msgs.msg you use earlier.

edit flag offensive delete link more

Comments

Thank you so much! That was really stupid ... Your solution worked perfectly

BBlumhofe gravatar image BBlumhofe  ( 2020-09-22 02:58:49 -0500 )edit

Question Tools

Stats

Asked: 2020-09-21 09:36:12 -0500

Seen: 907 times

Last updated: Sep 21 '20