Feat/unitree go2 mppi connector#2617
Open
jerinpeter wants to merge 4 commits into
Open
Conversation
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>
… comments and improving clarity
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Contributor
There was a problem hiding this comment.
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 newunitree_go2_autonomy/move_mppiconnector 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 theunitree_go2_autonomyaction. - Updated
.gitignoreto 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)) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
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.Configuration for Autonomy Mode:
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:
These changes collectively improve the robot's ability to navigate complex environments and respond more naturally to user commands.
References: [1] [2]