Skip to content
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

Jazzy updates #229

Merged
merged 34 commits into from
Aug 16, 2024
Merged

Jazzy updates #229

merged 34 commits into from
Aug 16, 2024

Conversation

civerachb-cpr
Copy link
Contributor

Description

Several fixes & changes needed for Jazzy support:

  • renames ign and ignition related nodes to use gz or sim (per new nomenclature)
  • updates gazebo plugin & resource environment variables to use the new GZ_* nomenclature
  • adds GzSceneManager and InteractiveViewControl plugins to gui.config (needed for the visualization to render correctly & allow camera movement)
  • fixes a bug where dock & undock behaviours could be preempted by e.g. reflex, causing their associated ROS actions to cancel
  • updates diff_drive_controller interaction to use TwistStamped messages (per recent changes from ROS controllers)
  • replace NotEqualsSubstitution(...) with IfCondition(NotEqualsSubstitution(...)) (deprecation)
  • slight change to the maze world to ensure the robot's default spawn location doesn't clip into wall 12

How Has This Been Tested?

Tested on Ubuntu 24.04. Able to successfully:

  • dock & undock the robot using the action servers
  • control the robot using on-screen teleop controls + keyboard controls
  • visualize the robot & dock in Rviz2
  • drive the robot into an obstacle to trigger reflex behaviours
# To start the simulation
ros2 launch irobot_create_gz_bringup create3_gz.launch.py

Wait for the simulation to load fully (may take several seconds, depending on the specs of the machine being used), then press the orange play button to start the simulation. The fan in the depot ceiling will spin when the simulation is running. Rviz will show the robot & dock.

To undock the robot:

ros2 action send_goal /undock irobot_create_msgs/action/Undock {}

To dock the robot:

ros2 action send_goal /dock irobot_create_msgs/action/Dock {} --feedback

@alsora
Copy link
Contributor

alsora commented Jul 29, 2024

Overall looks good, thanks for the work!
I'll give it a try and do a deeper review in the next days

@civerachb-cpr
Copy link
Contributor Author

No big rush. I imagine there may be a few additional updates as I continue testing with the Turtlebot4 packages. But this should give a good base for the remaining Jazzy work.

@@ -12,6 +12,7 @@ endif()

find_package(ament_cmake REQUIRED)
find_package(ament_cmake_python REQUIRED)
find_package(rclpy REQUIRED)
Copy link
Contributor

Choose a reason for hiding this comment

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

why this addition? if we need it, we should also add it to the package.xml, but i don't see it being used

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's a vestigial leftover from some earlier development that I reverted, though apparently incompletely. Fixed.

@@ -106,10 +106,10 @@ class MotionControlNode : public rclcpp::Node

rclcpp::Subscription<irobot_create_msgs::msg::HazardDetectionVector>::SharedPtr
hazard_detection_sub_;
rclcpp::Subscription<geometry_msgs::msg::Twist>::SharedPtr teleop_subscription_;
rclcpp::Subscription<geometry_msgs::msg::TwistStamped>::SharedPtr teleop_subscription_;
Copy link
Contributor

Choose a reason for hiding this comment

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

we should keep both subscriptions

Copy link
Contributor Author

@civerachb-cpr civerachb-cpr Aug 13, 2024

Choose a reason for hiding this comment

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

For Jazzy I'm not sure the Twist subscription is still necessary. ROS Control dropped support for unstamped messages in Jazzy. I can add it back if you really want, but what are you expecting will be using the unstamped version?

I've added cmd_vel_unstamped as a new subscription. I'm still not thoroughly convinced it's necessary for Jazzy, but including it won't be harmful.

Copy link
Contributor

Choose a reason for hiding this comment

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

Users could have developed their own controller applications and may still be using the old data type

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's fair. Though in the context of Jazzy I'd argue the correct solution is to require the custom controllers/applications to be updated to the new standard, rather than continuing to support the old one.

Regardless, I've added the second subscription and it appears to be working correctly.

default_cmd.angular.x = 0;
default_cmd.angular.y = 0;
default_cmd.angular.z = 0;
geometry_msgs::msg::TwistStamped default_cmd;
Copy link
Contributor

@alsora alsora Aug 12, 2024

Choose a reason for hiding this comment

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

we should set the stamp as

default_cmd.header.stamp = this->now();

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed this in a slightly different way than above, but the result is the same.

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

2.1.0 (2023-05-15)
------------------
* Multi robot support (`#207 <https://github.com/iRobotEducation/create3_sim/issues/207>`_)
* Added ign_ros2_control dependency as it is released now. (`#204 <https://github.com/iRobotEducation/create3_sim/issues/204>`_)
* Added gz_ros2_control dependency as it is released now. (`#204 <https://github.com/iRobotEducation/create3_sim/issues/204>`_)
Copy link
Contributor

@alsora alsora Aug 12, 2024

Choose a reason for hiding this comment

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

undo changes to the changelog (this comment applies to all the changelog files, not just this one)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Whoops. The dangers of search & replace. Fixed now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed the remaining changes to the changelogs.

@alsora
Copy link
Contributor

alsora commented Aug 12, 2024

I did an additional review and, besides the small comments above, everything looks good.

…ternally, set the stamp outside that function (since we may create the command, do some math, and then publish it later). Add an unstamped velocity command input
@civerachb-cpr
Copy link
Contributor Author

I think I've addressed all the issues raised above.

@alsora
Copy link
Contributor

alsora commented Aug 14, 2024

@civerachb-cpr there's still a few CHANGELOG files that have been inadvertently modified.
Can you please revert these changes as well?

@alsora alsora merged commit 71cda80 into iRobotEducation:jazzy Aug 16, 2024
1 check passed
@azeey
Copy link

azeey commented Aug 26, 2024

Great to see this update. Just wanted to drop https://gazebosim.org/docs/latest/ros2_gz_vendor_pkgs/ in case you haven't seen it. Also, since Gazebo is now available from packages.ros.org, there's no need for the instructions that add the packages.osrfoundation.org repo.

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.

3 participants