-
Notifications
You must be signed in to change notification settings - Fork 83
Update machine learning package for Jazzy #75
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.
Hello @chan-1207, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
Summary of Changes
This pull request updates the turtlebot3_dqn
and turtlebot3_machine_learning
packages to support ROS 2 Jazzy and uses Gazebo sim. The key changes include updating the cmd_vel
message type from geometry_msgs/msg/Twist
to geometry_msgs/msg/TwistStamped
in dqn_environment.py
, revising the goal box spawn/delete API in dqn_gazebo.py
, and preparing for upcoming turtlebot3_simulation
package updates for Gazebo Harmonic (GzSim 8) compatibility. The package versions in package.xml
and setup.py
have been bumped to 1.0.1, and corresponding updates have been made to CHANGELOG.rst
files.
Highlights
- ROS 2 Jazzy Support: The packages are now compatible with ROS 2 Jazzy.
- cmd_vel Message Update: The
cmd_vel
message type has been updated togeometry_msgs/msg/TwistStamped
. - Goal Box API Revision: Improved the usage of the goal_box spawn/delete API in
dqn_gazebo.py
using gz services. - Gazebo Harmonic Compatibility: Preparing for SDF and launch file improvements for Gazebo Harmonic (GzSim 8) compatibility.
Changelog
Click here to see the changelog
- turtlebot3_dqn/CHANGELOG.rst
- Added version 1.0.1 changelog entry.
- Indicated support for ROS 2 Jazzy version.
- Noted the usage of Gazebo sim for the package.
- turtlebot3_dqn/package.xml
- Updated package version to 1.0.1.
- turtlebot3_dqn/setup.py
- Updated package version to 1.0.1.
- turtlebot3_dqn/turtlebot3_dqn/dqn_environment.py
- Changed import from
geometry_msgs.msg import Twist
togeometry_msgs.msg import TwistStamped
(line 22). - Updated
cmd_vel_pub
publisher to useTwistStamped
(line 66). - Added a log info message when the environment is called (line 115).
- Updated
cmd_vel_pub.publish
calls to useTwistStamped
(lines 217, 225, 233, 273, 297). - Modified
rl_agent_interface_callback
to useTwistStamped
and access linear/angular velocities viatwist.twist
(lines 273-275).
- Changed import from
- turtlebot3_dqn/turtlebot3_dqn/dqn_gazebo.py
- Removed imports for
gazebo_msgs.srv
andgeometry_msgs.msg.Pose
andstd_srvs.srv.Empty
(lines 26-28, 32). - Replaced the usage of gazebo_msgs services with gz services to spawn and delete entities (lines 51-53, 64-144).
- Added a function to reset the burger model (lines 107-144).
- Removed imports for
- turtlebot3_machine_learning/CHANGELOG.rst
- Added version 1.0.1 changelog entry.
- Indicated support for ROS 2 Jazzy version.
- Noted the usage of Gazebo sim for the package.
- turtlebot3_machine_learning/package.xml
- Updated package version to 1.0.1.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command>
or @gemini-code-assist <command>
. Below is a summary of the supported commands.
Feature | Command | Description |
---|---|---|
Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/
folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
In Jazzy's ROS,
A stamped twist, a goal's new pose,
Learning robots bloom.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
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.
Code Review
This pull request updates the turtlebot3_dqn package to support ROS 2 Jazzy and introduces changes to the cmd_vel message type and goal_box spawn/delete API. The changes seem well-structured and address the compatibility issues with ROS 2 Jazzy. However, there are a few areas that could be improved for clarity and efficiency.
Summary of Findings
- TwistStamped Usage: The change from
geometry_msgs/msg/Twist
togeometry_msgs/msg/TwistStamped
requires ensuring that the timestamp is correctly populated when publishingcmd_vel
messages. Otherwise, the agent might not behave as expected. - Gazebo Service Calls: The transition to using
gz service
calls for spawning and deleting entities is a significant change. It's important to ensure that these calls are robust and handle potential errors gracefully. The current implementation usessubprocess.run
withcheck=True
, but the exception handling could be improved. - Burger Reset Logic: The
reset_burger
function includes atime.sleep(0.2)
call, which might introduce unnecessary delays. Consider whether this delay is truly necessary and if there are alternative ways to ensure the burger is properly reset.
Merge Readiness
The pull request introduces important updates for ROS 2 Jazzy compatibility. While the core functionality seems to be working as intended, there are several areas where improvements can be made to enhance the robustness and clarity of the code. I recommend addressing the identified issues before merging. I am unable to directly approve this pull request, and other reviewers should also review this code before merging.
Pull Request Summary
This PR adds support for ROS 2 Jazzy and introduces the following key changes:
cmd_vel Message Update
goal_box Spawn/Delete API Revision
Upcoming turtlebot3_simulation Package Update
Validation
Verified successful colcon build and ros2 launch on a Jazzy development environment
Confirmed cmd_vel publishing and subscription with TwistStamped messages
Tested spawn_entity / delete_entity in Gazebo
Tested that the action graph / result graph works.