Skip to content

Feat/unitree go2 mppi connector#2617

Open
jerinpeter wants to merge 4 commits into
mainfrom
feat/unitree-go2-mppi-connector
Open

Feat/unitree go2 mppi connector#2617
jerinpeter wants to merge 4 commits into
mainfrom
feat/unitree-go2-mppi-connector

Conversation

@jerinpeter

Copy link
Copy Markdown
Contributor

This pull request introduces a new MPPI-based movement connector for the Unitree Go2 robot, providing an alternative to the existing turn-then-drive approach. It also adds a corresponding configuration file for the new autonomy mode. The main focus is enabling more natural and flexible robot navigation by delegating path planning to the om_mppi local planner, which handles smooth, obstacle-avoiding movements.

New MPPI Movement Connector:

  • Added move_mppi.go, a new connector that selects an obstacle-free direction and publishes a short-term goal for the om_mppi planner, allowing for smoother and safer navigation. This connector listens for AI commands, manages movement state, and handles goal timeouts and completion notifications.
  • Implements logic for handling commands like "move forwards," "turn left/right," "move back," and "stand still," with robust state management and integration with Zenoh topics for communication.

Configuration for Autonomy Mode:

  • Introduced unitree_go2_autonomy_mppi.json5, a configuration file that defines the new autonomy mode using the MPPI connector, including system prompts, agent inputs, actions, and LLM settings for the robot "Bits."

Integration and Safety Features:

  • The new connector includes support for guard mode (pausing movement if unknown faces are detected), AI control enable/disable/status requests, and automatic timeout handling to prevent the robot from getting stuck if a goal is not completed.

These changes collectively improve the robot's ability to navigate complex environments and respond more naturally to user commands.

References: [1] [2]

jerinpeter and others added 2 commits June 9, 2026 12:21
Add an alternative `unitree_go2_autonomy/move_mppi` connector. Instead of
driving the robot itself, it picks an obstacle-free direction from om_paths
and publishes a goal pose on "om/mppi/goal" (geometry_msgs/Pose, body frame)
for the om_mppi local planner to execute as a smooth, obstacle-avoiding
/cmd_vel. Completion is reported on "om/mppi/status", which gates when the
next AI command may be issued. AI enable/disable/status handling mirrors the
default move connector.

Wire it up via config/unitree_go2_autonomy_mppi.json5 (swap the autonomy
connector to "move" for the original turn-then-drive behaviour).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 9, 2026 19:26
@jerinpeter jerinpeter requested review from a team as code owners June 9, 2026 19:26
@github-actions github-actions Bot added config Configuration files plugins go labels Jun 9, 2026
@codecov

codecov Bot commented Jun 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 63.47826% with 84 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
plugins/actions/unitree/go2/autonomy/move_mppi.go 63.47% 77 Missing and 7 partials ⚠️

📢 Thoughts on this report? Let us know!

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Introduces an alternative Unitree Go2 autonomy movement connector that delegates local motion planning to an MPPI planner by publishing short-horizon goal poses, along with a new autonomy configuration to run the robot in this MPPI-driven mode.

Changes:

  • Added move_mppi.go: a new unitree_go2_autonomy/move_mppi connector that publishes MPPI goals (om/mppi/goal) and gates new commands based on planner status (om/mppi/status) with timeout handling.
  • Added unitree_go2_autonomy_mppi.json5: a new runtime configuration selecting the MPPI connector for the unitree_go2_autonomy action.
  • Updated .gitignore to ignore Python bytecode/cache artifacts.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 6 comments.

File Description
plugins/actions/unitree/go2/autonomy/move_mppi.go Adds the MPPI-based movement connector, goal serialization, status handling, and AI enable/disable support.
config/unitree_go2_autonomy_mppi.json5 Adds a new autonomy mode configuration that uses the MPPI connector.
.gitignore Ignores Python compiled/cache files.

Comment on lines +229 to +243
func (c *moveMPPIConnector) issueGoal(options []uint32, label string) {
if len(options) == 0 {
c.log.Warn("cannot " + label + " due to barrier")
return
}

angleRad := pathAngles[options[c.rng.Intn(len(options))]] * math.Pi / 180.0
bx := c.goalDistance * math.Cos(angleRad)
by := c.goalDistance * math.Sin(angleRad)
c.publishGoal(bx, by, angleRad)
c.markActive()
c.log.Info("issued mppi goal",
zap.String("label", label),
zap.Float64("goal_x", bx), zap.Float64("goal_y", by))
}
Comment on lines +246 to +254
func (c *moveMPPIConnector) issueRetreat(allowed bool) {
if !allowed {
c.log.Warn("cannot retreat due to barrier")
return
}
c.publishReverseGoal(mppiReverseDistanceM)
c.markActive()
c.log.Info("issued mppi reverse goal")
}
Comment on lines +261 to +263
if err := c.goalPub.Put(serializePose(x, y, yaw, false)); err != nil {
c.log.Error("goal put failed", zap.Error(err))
}
Comment on lines +273 to +275
if err := c.goalPub.Put(serializePose(-distance, 0, 0, true)); err != nil {
c.log.Error("reverse goal put failed", zap.Error(err))
}
Comment thread plugins/actions/unitree/go2/autonomy/move_mppi.go Outdated
Comment thread plugins/actions/unitree/go2/autonomy/move_mppi.go
@github-actions github-actions Bot added the tests Test files label Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

config Configuration files go plugins tests Test files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants