Skip to content

State Machine Switching Example

Terminal window
source install/setup.bash
ros2 run dr02_pro state_machine

After starting the state machine, use keyboard control via the terminal:

Terminal window
# Start the state machine
ros2 run dr02_pro state_machine
# Press keys in the terminal:
# z - Enter ZeroPos (return to zero position)
# c - Enter RLControl (RL control)
# r - Enter JointDamping (joint damping)
# w/s - Forward/backward (in RLControl state)
# a/d - Left/right
# q/e - Turn left/right

Ensure the gamepad is connected and publishing data via the /GAMEPAD_KEY topic:

Terminal window
# Monitor gamepad buttons
ros2 topic echo /GAMEPAD_KEY
# Then press gamepad buttons:
# L1 - Enter ZeroPos
# L2 - Enter RLControl
# R2 - Enter JointDamping
  1. Exit the SDK program in the terminal
  2. Switch the robot back to Idle state
  3. Exit developer mode via the gamepad