- Launch:
ros2 launch launch.py
. This will automatically trigger transitions and calibration to reach theVEL_CONTROL
state.- Now that we are in the
VEL_CONTROL
state, we can send twist messages to thecmd_vel
topic (using joystick or keyboard). - To view the computed velocities, echo the
/cmd_vel_out
topic or/OdriveJsonSub
topic
- Now that we are in the
- To reset back to the
UNINIT
state, runros2 service call /state_manager/change_mc_state motor_controller/srv/ChangeState "{transition: {id: 64, label: 'reset'}}"
- To recalibrate after reset, run
ros2 service call /state_manager/change_mc_state motor_controller/srv/ChangeState "{transition: {id: 6, label: 'calibrate'}}"
- To transition to the
VEL_CONTROL
state again, runros2 service call /state_manager/change_mc_state motor_controller/srv/ChangeState "{transition: {id: 12, label: 'active_vel_control'}}"
Subscribes to Twist messages from cmd_vel
topic and computes two values (l
and r
) for left and right side motor speeds.
l
and r
are published to the arcade_speed
topic.
Subscribes to arcade_speed
topic and computes 6 motor speeds (3 left, 3 right) using l
and r
as baseline.
The 6 motor speeds are published to the cmd_vel_out
topic.
Manages transitions between states. TODO: UPDATE THE DIAGRAM