lgsvl / simulator

A ROS/ROS2 Multi-robot Simulator for Autonomous Vehicles
Other
2.29k stars 781 forks source link

How to control simualtion car through VehicleCmd with accel/brake/steercmd #1354

Open kjs675252 opened 3 years ago

kjs675252 commented 3 years ago

Hi everyone!

Now I publish "/vehicle_cmd" ROS message with type "autoware_msgs/VehicleCmd".

================================================ Header header autoware_msgs/SteerCmd steer_cmd autoware_msgs/AccelCmd accel_cmd autoware_msgs/BrakeCmd brake_cmd autoware_msgs/LampCmd lamp_cmd int32 gear int32 mode geometry_msgs/TwistStamped twist_cmd autoware_msgs/ControlCommand ctrl_cmd int32 emergency

I use "ctrl_cmd" to make accel/steer control command and set gear to 64.

And then I want to use "steer_cmd&accel_cmd&brake_cmd" to make accel/brake/steer control such as pedal throttle control.

How can I solve this?!

hadiTab commented 3 years ago

@kjs675252 unfortunately the autoware_msgs/VehicleCmd is a bit poorly designed as it has a lot of overlapping functions in the same message that can conflict with each other. Right now we only support the twist_cmd or use ctrl_cmd with the gear set to 64. If you wish to use the other three commands you would need to make a separate control sensor that uses those messages.