Skip to content

Refactor - #42

Closed
fabio-amadio wants to merge 38 commits into
manumerous:mainfrom
fabio-amadio:refactor
Closed

Refactor#42
fabio-amadio wants to merge 38 commits into
manumerous:mainfrom
fabio-amadio:refactor

Conversation

@fabio-amadio

@fabio-amadio fabio-amadio commented Apr 30, 2026

Copy link
Copy Markdown

Summary by CodeRabbit

  • New Features

    • Centroidal dynamics MPC for G1 humanoid with hand pose control and interactive visualization
    • Hand-pose interactive markers with workspace visualization
    • Waist orientation control (yaw, roll, pitch) in motion commands
    • MPC motion reference publishing and recording tools
    • Motion reference generator for synthetic data creation
    • Base velocity controller GUI
  • Improvements

    • Upgraded to ROS 2 Humble with CycloneDDS middleware
    • Enhanced Docker development environment with persistent workspace
    • Updated keyboard and GUI control interfaces
  • Removals

    • Whole-body MPC implementation for G1
    • Xbox controller support (replaced by GUI-based control)

@coderabbitai

coderabbitai Bot commented Apr 30, 2026

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 18d9b1dc-f927-4369-a32f-4615c961362a

📥 Commits

Reviewing files that changed from the base of the PR and between a1f205c and 07982be.

📒 Files selected for processing (136)
  • .devcontainer/devcontainer.json
  • .gitignore
  • Makefile
  • README.md
  • dependencies.txt
  • docker/Dockerfile
  • docker/image_build.bash
  • docker/launch_wb_mpc.bash
  • humanoid_nmpc/humanoid_centroidal_mpc/CMakeLists.txt
  • humanoid_nmpc/humanoid_centroidal_mpc/include/humanoid_centroidal_mpc/command/CentroidalMpcTargetTrajectoriesCalculator.h
  • humanoid_nmpc/humanoid_centroidal_mpc/include/humanoid_centroidal_mpc/cost/FootSeparationCost.h
  • humanoid_nmpc/humanoid_centroidal_mpc/include/humanoid_centroidal_mpc/test/CentroidalTestingModelInterface.h
  • humanoid_nmpc/humanoid_centroidal_mpc/src/CentroidalMpcInterface.cpp
  • humanoid_nmpc/humanoid_centroidal_mpc/src/command/CentroidalMpcTargetTrajectoriesCalculator.cpp
  • humanoid_nmpc/humanoid_centroidal_mpc/src/cost/FootSeparationCost.cpp
  • humanoid_nmpc/humanoid_centroidal_mpc_ros2/CMakeLists.txt
  • humanoid_nmpc/humanoid_centroidal_mpc_ros2/package.xml
  • humanoid_nmpc/humanoid_centroidal_mpc_ros2/src/CentroidalMpcDummySimNode.cpp
  • humanoid_nmpc/humanoid_centroidal_mpc_ros2/src/CentroidalMpcMotionReferenceNode.cpp
  • humanoid_nmpc/humanoid_centroidal_mpc_ros2/src/CentroidalMpcRandomReferenceGenerator.cpp
  • humanoid_nmpc/humanoid_centroidal_mpc_ros2/src/CentroidalMpcRobotSim.cpp
  • humanoid_nmpc/humanoid_centroidal_mpc_ros2/src/CentroidalMpcSqpNode.cpp
  • humanoid_nmpc/humanoid_centroidal_mpc_ros2/src/CentroidalReferenceJointStateNode.cpp
  • humanoid_nmpc/humanoid_centroidal_mpc_ros2/test/testHumanoidVisualizer.cpp
  • humanoid_nmpc/humanoid_centroidal_mpc_test/CMakeLists.txt
  • humanoid_nmpc/humanoid_centroidal_mpc_test/include/humanoid_centroidal_mpc_test/CentroidalTestingModelInterface.h
  • humanoid_nmpc/humanoid_common_mpc/CMakeLists.txt
  • humanoid_nmpc/humanoid_common_mpc/include/humanoid_common_mpc/command/TargetTrajectoriesCalculatorBase.h
  • humanoid_nmpc/humanoid_common_mpc/include/humanoid_common_mpc/command/WalkingVelocityCommand.h
  • humanoid_nmpc/humanoid_common_mpc/include/humanoid_common_mpc/common/ModelSettings.h
  • humanoid_nmpc/humanoid_common_mpc/include/humanoid_common_mpc/cost/EndEffectorKinematicsQuadraticCost.h
  • humanoid_nmpc/humanoid_common_mpc/include/humanoid_common_mpc/gait/GaitScheduleUpdater.h
  • humanoid_nmpc/humanoid_common_mpc/include/humanoid_common_mpc/reference_manager/HandPoseReferenceManager.h
  • humanoid_nmpc/humanoid_common_mpc/include/humanoid_common_mpc/reference_manager/ProceduralMpcMotionManager.h
  • humanoid_nmpc/humanoid_common_mpc/include/humanoid_common_mpc/reference_manager/SwitchedModelReferenceManager.h
  • humanoid_nmpc/humanoid_common_mpc/src/command/TargetTrajectoriesCalculatorBase.cpp
  • humanoid_nmpc/humanoid_common_mpc/src/common/ModelSettings.cpp
  • humanoid_nmpc/humanoid_common_mpc/src/cost/EndEffectorKinematicsQuadraticCost.cpp
  • humanoid_nmpc/humanoid_common_mpc/src/gait/GaitSchedule.cpp
  • humanoid_nmpc/humanoid_common_mpc/src/reference_manager/HandPoseReferenceManager.cpp
  • humanoid_nmpc/humanoid_common_mpc/src/reference_manager/ProceduralMpcMotionManager.cpp
  • humanoid_nmpc/humanoid_common_mpc_pyutils/humanoid_common_mpc_pyutils/mpc_motion_reference_recorder.py
  • humanoid_nmpc/humanoid_common_mpc_pyutils/humanoid_common_mpc_pyutils/mpc_observation_logger.py
  • humanoid_nmpc/humanoid_common_mpc_pyutils/package.xml
  • humanoid_nmpc/humanoid_common_mpc_pyutils/setup.py
  • humanoid_nmpc/humanoid_common_mpc_pyutils/test/test_xbox_controller.py
  • humanoid_nmpc/humanoid_common_mpc_ros2/CMakeLists.txt
  • humanoid_nmpc/humanoid_common_mpc_ros2/humanoid_common_mpc_ros2/mpc_launch_config.py
  • humanoid_nmpc/humanoid_common_mpc_ros2/humanoid_common_mpc_ros2/urdf_prefix.py
  • humanoid_nmpc/humanoid_common_mpc_ros2/include/humanoid_common_mpc_ros2/ros_comm/MRTPolicySubscriber.h
  • humanoid_nmpc/humanoid_common_mpc_ros2/include/humanoid_common_mpc_ros2/ros_comm/Ros2ProceduralMpcMotionManager.h
  • humanoid_nmpc/humanoid_common_mpc_ros2/include/humanoid_common_mpc_ros2/visualization/HumanoidVisualizer.h
  • humanoid_nmpc/humanoid_common_mpc_ros2/include/humanoid_common_mpc_ros2/visualization/HumanoidVisualizerRos2Interface.h
  • humanoid_nmpc/humanoid_common_mpc_ros2/package.xml
  • humanoid_nmpc/humanoid_common_mpc_ros2/rviz/humanoid.rviz
  • humanoid_nmpc/humanoid_common_mpc_ros2/src/ros_comm/Ros2ProceduralMpcMotionManager.cpp
  • humanoid_nmpc/humanoid_common_mpc_ros2/src/ros_comm/VelocityCommandKeyboardPublisher.cpp
  • humanoid_nmpc/humanoid_common_mpc_ros2/src/visualization/COMVisualizer.cpp
  • humanoid_nmpc/humanoid_common_mpc_ros2/src/visualization/HumanoidVisualizer.cpp
  • humanoid_nmpc/humanoid_common_mpc_ros2/src/visualization/HumanoidVisualizerRos2Interface.cpp
  • humanoid_nmpc/humanoid_mpc_msgs/CMakeLists.txt
  • humanoid_nmpc/humanoid_mpc_msgs/msg/MpcMotionReference.msg
  • humanoid_nmpc/humanoid_mpc_msgs/msg/WalkingVelocityCommand.idl
  • humanoid_nmpc/humanoid_wb_mpc/CMakeLists.txt
  • humanoid_nmpc/humanoid_wb_mpc/include/humanoid_wb_mpc/WBMpcInterface.h
  • humanoid_nmpc/humanoid_wb_mpc/include/humanoid_wb_mpc/WBMpcPreComputation.h
  • humanoid_nmpc/humanoid_wb_mpc/include/humanoid_wb_mpc/command/WBMpcTargetTrajectoriesCalculator.h
  • humanoid_nmpc/humanoid_wb_mpc/include/humanoid_wb_mpc/common/WBAccelMpcRobotModel.h
  • humanoid_nmpc/humanoid_wb_mpc/include/humanoid_wb_mpc/common/WBAccelPinocchioStateInputMapping.h
  • humanoid_nmpc/humanoid_wb_mpc/include/humanoid_wb_mpc/constraint/EndEffectorDynamicsAccelerationsConstraint.h
  • humanoid_nmpc/humanoid_wb_mpc/include/humanoid_wb_mpc/constraint/EndEffectorDynamicsLinearAccConstraint.h
  • humanoid_nmpc/humanoid_wb_mpc/include/humanoid_wb_mpc/constraint/JointMimicDynamicsConstraint.h
  • humanoid_nmpc/humanoid_wb_mpc/include/humanoid_wb_mpc/constraint/SwingLegVerticalConstraintCppAd.h
  • humanoid_nmpc/humanoid_wb_mpc/include/humanoid_wb_mpc/constraint/ZeroAccelerationConstraintCppAd.h
  • humanoid_nmpc/humanoid_wb_mpc/include/humanoid_wb_mpc/cost/EndEffectorDynamicsCostHelpers.h
  • humanoid_nmpc/humanoid_wb_mpc/include/humanoid_wb_mpc/cost/EndEffectorDynamicsFootCost.h
  • humanoid_nmpc/humanoid_wb_mpc/include/humanoid_wb_mpc/cost/EndEffectorDynamicsQuadraticCost.h
  • humanoid_nmpc/humanoid_wb_mpc/include/humanoid_wb_mpc/dynamics/DynamicsHelperFunctions.h
  • humanoid_nmpc/humanoid_wb_mpc/include/humanoid_wb_mpc/dynamics/WBAccelDynamicsAD.h
  • humanoid_nmpc/humanoid_wb_mpc/include/humanoid_wb_mpc/end_effector/EndEffectorDynamics.h
  • humanoid_nmpc/humanoid_wb_mpc/include/humanoid_wb_mpc/end_effector/PinocchioEndEffectorDynamicsCppAd.h
  • humanoid_nmpc/humanoid_wb_mpc/include/humanoid_wb_mpc/mrt/WBMpcMrtJointController.h
  • humanoid_nmpc/humanoid_wb_mpc/package.xml
  • humanoid_nmpc/humanoid_wb_mpc/src/WBMpcInterface.cpp
  • humanoid_nmpc/humanoid_wb_mpc/src/WBMpcPreComputation.cpp
  • humanoid_nmpc/humanoid_wb_mpc/src/command/WBMpcTargetTrajectoriesCalculator.cpp
  • humanoid_nmpc/humanoid_wb_mpc/src/constraint/EndEffectorDynamicsAccelerationsConstraint.cpp
  • humanoid_nmpc/humanoid_wb_mpc/src/constraint/EndEffectorDynamicsLinearAccConstraint.cpp
  • humanoid_nmpc/humanoid_wb_mpc/src/constraint/JointMimicDynamicsConstraint.cpp
  • humanoid_nmpc/humanoid_wb_mpc/src/constraint/SwingLegVerticalConstraintCppAd.cpp
  • humanoid_nmpc/humanoid_wb_mpc/src/constraint/ZeroAccelerationConstraintCppAd.cpp
  • humanoid_nmpc/humanoid_wb_mpc/src/cost/EndEffectorDynamicsCostHelpers.cpp
  • humanoid_nmpc/humanoid_wb_mpc/src/cost/EndEffectorDynamicsFootCost.cpp
  • humanoid_nmpc/humanoid_wb_mpc/src/cost/EndEffectorDynamicsQuadraticCost.cpp
  • humanoid_nmpc/humanoid_wb_mpc/src/cost/JointTorqueCostCppAd.cpp
  • humanoid_nmpc/humanoid_wb_mpc/src/dynamics/DynamicsHelperFunctions.cpp
  • humanoid_nmpc/humanoid_wb_mpc/src/dynamics/WBAccelDynamicsAD.cpp
  • humanoid_nmpc/humanoid_wb_mpc/src/end_effector/PinocchioEndEffectorDynamicsCppAd.cpp
  • humanoid_nmpc/humanoid_wb_mpc/src/mrt/WBMpcMrtJointController.cpp
  • humanoid_nmpc/humanoid_wb_mpc_ros2/CMakeLists.txt
  • humanoid_nmpc/humanoid_wb_mpc_ros2/package.xml
  • humanoid_nmpc/humanoid_wb_mpc_ros2/src/WBMpcDummySimNode.cpp
  • humanoid_nmpc/humanoid_wb_mpc_ros2/src/WBMpcPoseCommandNode.cpp
  • humanoid_nmpc/humanoid_wb_mpc_ros2/src/WBMpcRobotSim.cpp
  • humanoid_nmpc/humanoid_wb_mpc_ros2/src/WBMpcSqpNode.cpp
  • humanoid_nmpc/remote_control/launch/xbox_velocity_publisher.launch.py
  • humanoid_nmpc/remote_control/package.xml
  • humanoid_nmpc/remote_control/remote_control/__init__.py
  • humanoid_nmpc/remote_control/remote_control/base_velocity_controller_gui.py
  • humanoid_nmpc/remote_control/remote_control/keyboard_walking_command_publisher.py
  • humanoid_nmpc/remote_control/remote_control/xbox_controller_interface.py
  • humanoid_nmpc/remote_control/remote_control/xbox_walking_command_publisher.py
  • humanoid_nmpc/remote_control/requirements.txt
  • humanoid_nmpc/remote_control/setup.cfg
  • humanoid_nmpc/remote_control/setup.py
  • humanoid_nmpc/remote_control/test/test_xbox_controller.py
  • robot_models/unitree_g1/g1_centroidal_mpc/CMakeLists.txt
  • robot_models/unitree_g1/g1_centroidal_mpc/config/command/reference.info
  • robot_models/unitree_g1/g1_centroidal_mpc/config/command/reference_random_reference.info
  • robot_models/unitree_g1/g1_centroidal_mpc/config/mpc/task_hand_pose.info
  • robot_models/unitree_g1/g1_centroidal_mpc/config/mpc/task_locomotion.info
  • robot_models/unitree_g1/g1_centroidal_mpc/config/mpc/task_random_reference.info
  • robot_models/unitree_g1/g1_centroidal_mpc/launch/dummy_sim.launch.py
  • robot_models/unitree_g1/g1_centroidal_mpc/launch/dummy_sim_hands_cartesian.launch.py
  • robot_models/unitree_g1/g1_centroidal_mpc/launch/mujoco_sim.launch.py
  • robot_models/unitree_g1/g1_centroidal_mpc/launch/mujoco_sim_hands_cartesian.launch.py
  • robot_models/unitree_g1/g1_centroidal_mpc/test/testPinocchioModel.cpp
  • robot_models/unitree_g1/g1_wb_mpc/CMakeLists.txt
  • robot_models/unitree_g1/g1_wb_mpc/config/mpc/task.info
  • robot_models/unitree_g1/g1_wb_mpc/launch/dummy_sim.launch.py
  • robot_models/unitree_g1/g1_wb_mpc/launch/mujoco_sim.launch.py
  • robot_models/unitree_g1/g1_wb_mpc/launch/wb_dummy_sim.launch.py
  • robot_models/unitree_g1/g1_wb_mpc/package.xml
  • robot_runtime/robot_model/include/robot_model/RobotState.h
  • robot_runtime/robot_model/src/RobotDescription.cpp
  • setup_uri.sh

📝 Walkthrough

Walkthrough

The pull request transitions the MPC stack from whole-body to centroidal dynamics, upgrades the development environment from ROS Jazzy to Humble with CycloneDDS middleware, introduces hand-pose reference management with interactive visualization, adds new ROS2 nodes for publishing MPC motion references, and replaces Xbox controller input with GUI-based velocity commands.

Changes

Cohort / File(s) Summary
Environment & Docker
.devcontainer/devcontainer.json, docker/Dockerfile, docker/image_build.bash, docker/launch_wb_mpc.bash
ROS distribution changed to Humble, Python 3.12→3.10, added CycloneDDS RMW implementation, improved container state management with persistent workspace caching.
Infrastructure & Dependencies
.gitignore, Makefile, dependencies.txt, setup_uri.sh
Added Docker workspace ignore patterns, NumPy artifact filtering, dynamic ROS distro sourcing, ROS environment reset macros, new network interface setup script for CycloneDDS URI configuration.
Project Documentation
README.md
Rebranded project from whole-body to G1 centroidal MPC, updated build/deployment instructions, documented new Docker workflows, random motion generation, and task configuration parameters.
Core Centroidal MPC Library
humanoid_nmpc/humanoid_centroidal_mpc/CMakeLists.txt, humanoid_nmpc/humanoid_centroidal_mpc/include/humanoid_centroidal_mpc/cost/FootSeparationCost.h, humanoid_nmpc/humanoid_centroidal_mpc/src/cost/FootSeparationCost.cpp
Added FootSeparationCost implementation with configurable minimum lateral separation constraints, loads config from reference files.
Centroidal MPC Command Interface
humanoid_nmpc/humanoid_centroidal_mpc/include/humanoid_centroidal_mpc/command/CentroidalMpcTargetTrajectoriesCalculator.h, humanoid_nmpc/humanoid_centroidal_mpc/src/command/CentroidalMpcTargetTrajectoriesCalculator.cpp
Updated command interface to accept WalkingVelocityCommand instead of vector4_t, supports waist joint target mapping, improved trajectory interpolation with configurable velocity transition timing.
Centroidal MPC Core
humanoid_nmpc/humanoid_centroidal_mpc/src/CentroidalMpcInterface.cpp, humanoid_nmpc/humanoid_centroidal_mpc/include/humanoid_centroidal_mpc/test/CentroidalTestingModelInterface.h
Added FootSeparationCost loading/configuration, implemented reference-frame-based hand pose initialization with HandPoseReferenceManager integration, switched default task config to task_locomotion.info.
Common MPC Components
humanoid_nmpc/humanoid_common_mpc/CMakeLists.txt, humanoid_nmpc/humanoid_common_mpc/include/humanoid_common_mpc/command/..., humanoid_nmpc/humanoid_common_mpc/include/humanoid_common_mpc/reference_manager/HandPoseReferenceManager.h, humanoid_nmpc/humanoid_common_mpc/src/reference_manager/HandPoseReferenceManager.cpp
Introduced HandPoseReferenceManager with time-based interpolation, extended WalkingVelocityCommand with waist orientation targets (yaw/roll/pitch), added armSwingReferenceActive model setting, enhanced TargetTrajectoriesCalculatorBase with velocity transition timing.
End-Effector Kinematics Cost
humanoid_nmpc/humanoid_common_mpc/include/humanoid_common_mpc/cost/EndEffectorKinematicsQuadraticCost.h, humanoid_nmpc/humanoid_common_mpc/src/cost/EndEffectorKinematicsQuadraticCost.cpp
Extended to support external HandPoseReference management, added reference-frame-based kinematics, new getExternalReferenceCostElement method for time-indexed reference retrieval.
ROS2 Common MPC
humanoid_nmpc/humanoid_common_mpc_ros2/CMakeLists.txt, humanoid_nmpc/humanoid_common_mpc_ros2/include/.../HumanoidVisualizer.h, humanoid_nmpc/humanoid_common_mpc_ros2/src/visualization/HumanoidVisualizer.cpp
Added interactive hand pose markers with clamping to workspace bounds, hand workspace visualization via MarkerArray, updated joint states topic to mpc/joint_states namespace, extended constructor signature to include referenceFile parameter.
ROS2 Motion Management
humanoid_nmpc/humanoid_common_mpc_ros2/include/humanoid_common_mpc_ros2/ros_comm/Ros2ProceduralMpcMotionManager.h, humanoid_nmpc/humanoid_common_mpc_ros2/src/ros_comm/Ros2ProceduralMpcMotionManager.cpp
Added robotName parameter, hand pose subscriptions with per-axis clamping, waist orientation interpolation with transition timing configuration, updated getScaledWalkingVelocityCommand to be time-dependent.
ROS2 Launch Configuration
humanoid_nmpc/humanoid_common_mpc_ros2/humanoid_common_mpc_ros2/mpc_launch_config.py, humanoid_nmpc/humanoid_common_mpc_ros2/humanoid_common_mpc_ros2/urdf_prefix.py
Defined scoped robot_description/joint_states topics, switched URDF generation from xacro to urdf_prefix utility, added link name prefixing for multi-robot namespace isolation.
ROS2 Nodes
humanoid_nmpc/humanoid_centroidal_mpc_ros2/CMakeLists.txt, humanoid_nmpc/humanoid_centroidal_mpc_ros2/src/CentroidalMpcMotionReferenceNode.cpp, humanoid_nmpc/humanoid_centroidal_mpc_ros2/src/CentroidalReferenceJointStateNode.cpp, humanoid_nmpc/humanoid_centroidal_mpc_ros2/src/CentroidalMpcRandomReferenceGenerator.cpp
Added three new executables: reference joint state publisher, MPC motion reference publisher (with flattened motion_cmd layout), headless random reference generator with forked process safety and zlib compression.
Message Types
humanoid_nmpc/humanoid_mpc_msgs/CMakeLists.txt, humanoid_nmpc/humanoid_mpc_msgs/msg/MpcMotionReference.msg, humanoid_nmpc/humanoid_mpc_msgs/msg/WalkingVelocityCommand.idl
Added MpcMotionReference message type with joint/root kinematics and motion_cmd field, extended WalkingVelocityCommand with desired_waist_yaw/roll/pitch fields.
Python Utilities
humanoid_nmpc/humanoid_common_mpc_pyutils/..., humanoid_nmpc/humanoid_common_mpc_pyutils/humanoid_common_mpc_pyutils/mpc_motion_reference_recorder.py, humanoid_nmpc/humanoid_common_mpc_pyutils/humanoid_common_mpc_pyutils/mpc_observation_logger.py
Refactored observation logger to use row-based CSV writing instead of pandas, added MpcMotionReferenceRecorder for recording/exporting motion references to NPZ format.
Remote Control UI
humanoid_nmpc/remote_control/remote_control/base_velocity_controller_gui.py, humanoid_nmpc/remote_control/remote_control/keyboard_walking_command_publisher.py, humanoid_nmpc/remote_control/setup.py, humanoid_nmpc/remote_control/package.xml, humanoid_nmpc/remote_control/requirements.txt
Removed pygame Xbox controller support, added GUI sliders for waist joint control (yaw/roll/pitch), integrated waist targets into WalkingVelocityCommand, updated dependencies and console scripts.
Whole-Body MPC Package Removal
humanoid_nmpc/humanoid_wb_mpc/... (all files)
Deleted entire humanoid_wb_mpc package including WBAccelMpcRobotModel, all endpoint dynamics constraints/costs, dynamics AD implementation, MPC interface, and pre-computation logic.
Whole-Body MPC ROS2 Removal
humanoid_nmpc/humanoid_wb_mpc_ros2/... (all files)
Deleted all whole-body MPC ROS2 nodes (dummy sim, SQP node, pose command node, robot sim) and build configuration.
G1 Centroidal Config & Launch
robot_models/unitree_g1/g1_centroidal_mpc/config/mpc/task_*.info, robot_models/unitree_g1/g1_centroidal_mpc/launch/...
Added task_hand_pose.info and task_random_reference.info configurations, new launch scripts for hands Cartesian simulation, added publish_reference_joint_states and publish_mpc_motion_reference launch arguments.
G1 Centroidal Command Config
robot_models/unitree_g1/g1_centroidal_mpc/config/command/reference*.info
Enhanced command references with hand position/waist angle bounds, transition timing parameters for velocity/hand/waist updates, extended defaultJointState mapping for wrist joints.
G1 WB MPC Package Removal
robot_models/unitree_g1/g1_wb_mpc/... (all files)
Deleted entire G1 whole-body MPC package including CMakeLists.txt, task configuration, launch files, and package manifest.
Robot Runtime Updates
robot_runtime/robot_model/include/robot_model/RobotState.h, robot_runtime/robot_model/src/RobotDescription.cpp
Updated URDF parser header include path, reformatted method implementations and operator overloads, corrected EOF newlines.

Sequence Diagram

sequenceDiagram
    participant User as User/Visualization
    participant Visualizer as HumanoidVisualizer
    participant InteractiveMarkers as Interactive Marker Server
    participant HandPoseMgr as HandPoseReferenceManager
    participant ReferenceJointState as ReferenceJointStatePublisher
    participant MpcInterface as MPC Interface
    participant MotionRefPublisher as MotionReferencePublisher

    User->>Visualizer: Open interactive marker for hand pose
    Visualizer->>InteractiveMarkers: Create/update marker
    User->>InteractiveMarkers: Drag marker (with position clamping)
    InteractiveMarkers->>Visualizer: Feedback event
    Visualizer->>HandPoseMgr: setReference(hand_name, pose, transition_duration)
    HandPoseMgr->>HandPoseMgr: Store start/goal reference with timing
    
    Note over ReferenceJointState,MpcInterface: Parallel: Reference publishing loop
    MpcInterface->>ReferenceJointState: Policy available at time T
    ReferenceJointState->>HandPoseMgr: getReference(hand_name, time_T)
    HandPoseMgr->>HandPoseMgr: Interpolate pose using clamped alpha
    HandPoseMgr-->>ReferenceJointState: Interpolated HandPoseReference
    ReferenceJointState->>ReferenceJointState: Evaluate policy + derive kinematics
    ReferenceJointState-->>User: Publish JointState on mpc/reference_joint_states
    
    Note over MotionRefPublisher: Parallel: Motion reference loop
    MpcInterface->>MotionRefPublisher: Policy + state/input trajectories
    MotionRefPublisher->>MotionRefPublisher: Sample policy at time T+0.005
    MotionRefPublisher->>MotionRefPublisher: Compute full joint + body pose + twist
    MotionRefPublisher->>MotionRefPublisher: Flatten motion_cmd vector
    MotionRefPublisher-->>User: Publish MpcMotionReference on mpc/mpc_motion_reference
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~75 minutes

Poem

🐰 From whole-body dreams to centroid's grace,
We bounced through Jazzy to Humble's embrace,
Hand poses now interactive, fingers can dance,
While CycloneDDS connects every chance,
No Xbox joystick—just GUI with flair,
The MPC stack soars through the air! 🚀

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

@fabio-amadio
fabio-amadio deleted the refactor branch April 30, 2026 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant