-
Notifications
You must be signed in to change notification settings - Fork 940
OM1 publish welcome mode to ROS2 #2014
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds functionality to publish a "welcome mode" status message to ROS2, enabling the Go2 robot dog to initiate AprilTag detection and execute a 180° rotation upon receiving the message.
Changes:
- Added a new
WelcomeStatusPublisherbackground plugin that publishes status messages to ROS2 or Zenoh - Configured the publisher in
unitree_go2_autonomy_sim.json5to broadcast on theom/welcometopic - Commented out the existing
move_go2_autonomyagent action
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/backgrounds/plugins/welcome_status_publisher.py | New background plugin implementing periodic status message publishing with ROS2/Zenoh fallback |
| config/unitree_go2_autonomy_sim.json5 | Added WelcomeStatusPublisher configuration and commented out move_go2_autonomy action |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ros2_topic: "om/welcome", | ||
| zenoh_topic: "om/welcome", | ||
| message: "welcome mode", | ||
| interval: 1.0 |
Copilot
AI
Jan 30, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Publishing the welcome message every second may be excessive for a status that doesn't change. Consider increasing the interval to reduce network traffic and resource usage, or publish only once on startup if this is meant as an initialization signal.
| interval: 1.0 | |
| interval: 60.0 |
| # Prefer ROS2 | ||
| if self.ros2_provider is not None: | ||
| try: | ||
| self.ros2_provider.add_pending_message(text) |
Copilot
AI
Jan 30, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The add_pending_message method is being passed a plain string, but the ROS2PublisherProvider may expect a specific message type. Verify that ROS2PublisherProvider correctly handles string messages, or consider using a standard ROS2 String message type to ensure compatibility with ROS2 subscribers.
| except Exception: | ||
| # start may already have been called elsewhere | ||
| pass |
Copilot
AI
Jan 30, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Silently catching all exceptions when calling start() makes it difficult to distinguish between 'already started' and actual errors. Consider checking a provider state flag or catching a more specific exception type if the provider raises one for 'already started' scenarios.
| except Exception: | |
| # start may already have been called elsewhere | |
| pass | |
| except Exception as e: | |
| # start may already have been called elsewhere; log for diagnostics | |
| logging.debug("WelcomeStatusPublisher: ROS2 provider start() failed (may already be started): %s", e) |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
| // { | ||
| // name: "move_go2_autonomy", | ||
| // llm_label: "move", | ||
| // connector: "unitree_sdk_advance", | ||
| // }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert this.
| try: | ||
| import zenoh | ||
| except Exception: | ||
| zenoh = None | ||
|
|
||
| try: | ||
| from zenoh_msgs import String, open_zenoh_session | ||
| except Exception: | ||
| String = None | ||
| open_zenoh_session = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please import it directly
| try: | ||
| from providers.ros2_publisher_provider import ROS2PublisherProvider | ||
| except Exception: | ||
| ROS2PublisherProvider = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove it
Overview
[Provide a brief overview of the changes in this pull request.]
OM1 publish welcome mode topic to ROS2 (Go2 robotdog)
Go2 robotdog will Initial Listener for OM1 Welcome Mode
Once the Welcome Mode message is received,
the robotdog initiates AprilTag detection, subscribes to IMU data, and
executes a PID-based 180° rotation.
Type of change
Changes
[Detail the changes you have made in this pull request. Include any new features, bug fixes, or improvements.]
Add WelcomeStatusPublisher (welcome_status_publisher.py) in unitree_go2_autonomy_sim.json5
Checklist