ROS Node to convert AckermannDrive messages to CarlaEgoVehicleControl.
- A PID controller is used to control the acceleration/velocity.
- Reads the Vehicle Info, required for controlling from Carla (via carla ros bridge)
#install python simple-pid
pip install --user simple-pid
Initial parameters can be set via configuration file.
It is possible to modify the parameters during runtime via ROS dynamic reconfigure.
Topic | Type | Description |
---|---|---|
/carla/<ROLE NAME>/ackermann_cmd (subscriber) |
ackermann_msgs.AckermannDrive | Subscriber for stearing commands |
/carla/<ROLE NAME>/ackermann_control/control_info |
carla_ackermann_control.EgoVehicleControlInfo | The current values used within the controller (for debugging) |
The role name is specified within the configuration.
You can send command to the car using the topic /carla/<ROLE NAME>/ackermann_cmd
.
Examples for a ego vehicle with role_name 'ego_vehicle':
Forward movements, speed in in meters/sec.
rostopic pub /carla/ego_vehicle/ackermann_cmd ackermann_msgs/AckermannDrive "{steering_angle: 0.0, steering_angle_velocity: 0.0, speed: 10, acceleration: 0.0,
jerk: 0.0}" -r 10
Forward with steering
rostopic pub /carla/ego_vehicle/ackermann_cmd ackermann_msgs/AckermannDrive "{steering_angle: 1.22, steering_angle_velocity: 0.0, speed: 10, acceleration: 0.0,
jerk: 0.0}" -r 10
Info: the steering_angle is the driving angle (in radians) not the wheel angle.