Description
In Triton AI Racer, we use tai_interface/msg/VehicleControl to control the vehilce actuators (steering, throttle, braking). To control a VESC, however, to be compatable with vesc_driver_node, we need to convert and publish std_msgs/msg/Float64 for individual actuators. A package called vesc_tai_interface is needed which contains a vesc_tai_interface_node that does the conversion.
Desired Behavior
Subscribers
- The node shall subscribe to a
tai_interface/msg/VehicleControl topic called vehicle_cmd.
Publishers
- The node shall publish the following
std_msgs/msg/Float64 topics:
commands/motor/current
commands/motor/brake
commands/motor/speed
commands/servo/position
Parameters
The node shall share most parameters with vesc_driver_node for the actuator mappings, namely,
brake_max
brake_min
current_max
current_min
position_max
position_min
servo_max
servo_min
speed_max
speed_min
Read the source code to figure out their ranges and meanings.
In addition, the following three parameters are needed:
- 'servo_neutral
: the neutral steerign value might not be as simple as the average of servo_minandservo_max`. Some steering mechanism would have a slight different neutral value.
wheel_radius: useful for converting the speed in vehicle_cmd (m/s) to RPM
rpw_to_electrical_rpm_factor: Here is why this parameter exists.
The node should also support dynamic parameter configuration with parameter-change callback.
Logics
On receiving a vehicle_cmd,
- If
longitudinal_control_type is LON_CTL_THROTTLE_BRAKE, map and publish the throttle (current) and brake values
- If
longitudinal_control_type is LON_CTL_SPEED, map and publish the speed value (remember to convert from m/s to electrical RPM)
- If
lateral_control_type is LAT_CTL_OPENLOOP, use steering_openloop to map and publish steering
- The mapping has two segments:
servo_min to servo_neutral; servo_neutral to servo_max, each corresponding to (-1, 0) and (0, 1) in vehicle_cmd.steering_openloop.
- If
lateral_control_type is LAT_CTL_CLOSELOOP, throw an error. The VESC does not support closeloop steering at the moment.
Definition of Done
Description
In Triton AI Racer, we use
tai_interface/msg/VehicleControlto control the vehilce actuators (steering, throttle, braking). To control a VESC, however, to be compatable withvesc_driver_node, we need to convert and publishstd_msgs/msg/Float64for individual actuators. A package calledvesc_tai_interfaceis needed which contains avesc_tai_interface_nodethat does the conversion.Desired Behavior
Subscribers
tai_interface/msg/VehicleControltopic calledvehicle_cmd.Publishers
std_msgs/msg/Float64topics:commands/motor/currentcommands/motor/brakecommands/motor/speedcommands/servo/positionParameters
The node shall share most parameters with
vesc_driver_nodefor the actuator mappings, namely,brake_maxbrake_mincurrent_maxcurrent_minposition_maxposition_minservo_maxservo_minspeed_maxspeed_minRead the source code to figure out their ranges and meanings.
In addition, the following three parameters are needed:
: the neutral steerign value might not be as simple as the average ofservo_minandservo_max`. Some steering mechanism would have a slight different neutral value.wheel_radius: useful for converting the speed invehicle_cmd(m/s) to RPMrpw_to_electrical_rpm_factor: Here is why this parameter exists.The node should also support dynamic parameter configuration with parameter-change callback.
Logics
On receiving a
vehicle_cmd,longitudinal_control_typeisLON_CTL_THROTTLE_BRAKE, map and publish the throttle (current) and brake valueslongitudinal_control_typeisLON_CTL_SPEED, map and publish the speed value (remember to convert from m/s to electrical RPM)lateral_control_typeis LAT_CTL_OPENLOOP, usesteering_openloopto map and publish steeringservo_mintoservo_neutral;servo_neutraltoservo_max, each corresponding to (-1, 0) and (0, 1) invehicle_cmd.steering_openloop.lateral_control_typeis LAT_CTL_CLOSELOOP, throw an error. The VESC does not support closeloop steering at the moment.Definition of Done
joy_nodeandjoy_tai_interfaceto teleop.vesc_tai_interface/design/README.md)