Skip to content
Permalink
main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time

Control message format

In the case of the can_interface and webots_interface nodes, they listen for steering commands on the following topics. Only the topic that matches the currently selected mission will have its commands followed, the rest are ignored.

  • /acceleration_vel
  • /autocross_vel
  • /autonomous_vel
  • /skidpad_vel
  • /static_a_vel
  • /static_b_vel
  • /track_drive_vel

All of these topics accept geometry_msgs/Twist format messages.

Twist messages consist of 6 values.

  • 3 linear values (x, y and z).
    • Measured in meters per second (m/s).
  • 3 angular values (x, y and z).
    • Normally measured in radians per seconds (r/s).

We slightly abuse this message format and instead have the following.

  • linear.x, forward speed.
    • linear.x == 1, 1m/s forwards.
    • linear.x == 0, stop (rolling stop, no brakes).
  • linear.z, brakes.
    • linear.z == 1, full brakes 100%.
    • linear.z == 0, no brakes 0%.
  • angualr.z, steering angle.
    • angular.z == 0, straight.
    • angular.z == 0.418879 full left (~24 degrees).
    • angular.z == -0.418879 full right (~24 degrees).

Starting the car

For the real car, mission selection and starting the car is done using the screen on the side of the vehicle and the grossfunc switch. In the simulator we have simiulated versions.

To select the mission in the simulator you can use the following command. The number represents which mission you want to select.

rosservice call --wait /can_interface/mission_select 1

You can then flip the simulated grossfunc switch using this command.

rosservice call --wait /can_interface/grossfunc_toggle 1

Manual control

Once the car has started you can control the car by sending appropriate control messages. Sending ROS messages manually is done using the ```rostopic pub`` command.

  • rostopic pub [topic] [msg_type] [args]

So if we have put the vehicle into acceleration mission mode, we can send manual commands as shown below. This will tell the car to move forwards (linear x) at 1 m/s.

rostopic pub /acceleration_vel geometry_msgs/Twist -- '[1.0, 0.0, 0.0]' '[0.0, 0.0, 0.0]'

Where the control values are '[speed, NA, brakes]' '[NA, NA, steering]'.

Equally we can get the vehicle to turn with the following command.

rostopic pub /acceleration_vel geometry_msgs/Twist -- '[1.0, 0.0, 0.0]' '[0.0, 0.0, 0.5]'