How mike4192/spotmicro works
Project type and purpose
• This is a ROS-based robotics control system for the Spot Micro quadruped robot.
• It runs on a Raspberry Pi 3B (Ubuntu 16.04, ROS Kinetic) and on a remote PC.
• It implements a finite-state machine gait controller (sit, stand, walk, angle control), hardware interface to a PCA9685 servo board, sensor integration (RPLidar for SLAM), TF2/odometry, and several visualization and input nodes (RVIZ, matplotlib plots, keyboard, joystick, LCD).
File structure
Top-level organization:
• catkin workspace style, each subdirectory under src/ (in the user’s workspace) is a ROS package.
• Key packages:
– spot_micro_motion_cmd: C++ control node + YAML config + state machine & kinematics
– ros-i2cpwmboard (submodule): C++ hardware driver for PCA9685 via I²C
– spot_micro_keyboard_command & spot_micro_joy: Python input nodes (keyboard/joystick → motion commands)
– lcd_monitor: Python node to drive a 16×2 I²C LCD for realtime state output
– servo_move_keyboard: Python node for manual servo calibration
– spot_micro_plot: Python matplotlib visualization of robot body state
– spot_micro_rviz: URDF (xacro + STLs), RViz launch files, mapping/SLAM integration
– spot_micro_launch: aggregate launch files for complex workflows (e.g., motion+RViz, SLAM)
• launch/ directories contain .launch files wiring together nodes and parameters
• scripts/ / src/ hold Python or C++ node code
• config/ holds the spot_micro_motion_cmd.yaml with gait parameters, TF2 toggles, odom, etc.
README for additional insights
• Describes hardware: Raspberry Pi, PCA9685, 12 servos, optional LCD, RPLidar
• Node descriptions and interconnections (state machine, topics, TF2 frames)
• URDF used for RViz visualization, not for control
• SLAM uses hector_slam, RPLidar driver, and publishes maps
• Launch sequences:
• On Pi: i2cpwm_board + motion_cmd
• On PC: keyboard_command or joy + (optional RViz or plot)
• Optional SLAM launch for mapping
Detail
• Every ROS package and its role
• Submodule libraries only if they introduce unique runtime behavior (e.g., spot_micro_kinematics_cpp used inside motion_cmd)
• Note about the YAML config feeding parameters to the motion_cmd node
• TF frame hierarchy: odom → base_footprint → base_link → lidar_link