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

(WIP) Add Trajectory Cache Example #929

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

methylDragon
Copy link

@methylDragon methylDragon commented Jul 25, 2024

Description

Setup

sudo apt update
source /opt/ros/rolling

git clone -b ch3/trajectory-cache-example https://github.com/moveit/moveit2_tutorials.git
git clone -b ch3/trajectory_cache https://github.com/moveit/moveit2.git
vcs import < moveit2_tutorials/moveit2_tutorials.repos

# For some reason these are extra steps.
git clone -b ros2 https://github.com/moveit/py_binding_tools.git
sudo apt install ros-rolling-moveit-planners-chomp

rosdep install -r --from-paths . --ignore-src --rosdistro rolling -y
colcon build --packages-up-to moveit2_tutorials --cmake-args -DCMAKE_BUILD_TYPE=Release

Running

source /opt/ros/rolling
source install/setup.bash

# In one terminal: Start the move group
ros2 launch moveit2_tutorials trajectory_cache_move_group.launch.py

# In another: Launch the demo
ros2 launch moveit2_tutorials trajectory_cache_demo.launch.py

NOTE: Sometimes a randomly generated demo goal is unreachable (or there's a weird move_group issue). Just restart the demo to resolve the issue.

Demo

The demo is a 4-phase demo. Hit next on the rviz visual tools dialog to advance the demo!

See video: It showcases cache population, pruning, and fetching (4x speed)

  1. Plan and cache (no pruning)
  2. Plan and cache (with pruning)
  3. Fetch from cache and execute (also still planning and caching with pruning)
  4. Fetch from cache and execute, except with huge start tolerances

For (4), you should see the robot arm "snap" to the fetched trajectory. The diff of the robot's start position to the trajectory is visualized in red to be obvious.

Screenrecording2024-07-3012.33.03AM-ezgif.com-crop-video.2.webm

@methylDragon methylDragon marked this pull request as draft July 25, 2024 01:24
CMakeLists.txt Outdated
@@ -62,6 +62,7 @@ add_subdirectory(doc/examples/planning_scene)
add_subdirectory(doc/examples/planning_scene_ros_api)
add_subdirectory(doc/examples/realtime_servo)
add_subdirectory(doc/examples/robot_model_and_robot_state)
add_subdirectory(doc/examples/trajectory_cache)
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for adding a tutorial! I know that this is still WIP, but just figured I'd mention:

Please add your tutorial to the how to guides! The examples are for older tutorials, including some that are unmigrated from ROS 1. The page has this big ol' section at the top:
image

I wouldn't want your tutorial to get lost in there.

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for adding a tutorial! I know that this is still WIP, but just figured I'd mention:

Please add your tutorial to the how to guides! The examples are for older tutorials, including some that are unmigrated from ROS 1. The page has this big ol' section at the top: image

I wouldn't want your tutorial to get lost in there.

Oh! What if I don't have the time to write a full tutorial, but just wanted to add a usage example for a PR that is in flight? Where is the best place for that?

The PR in question is:

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds like a how-to is the perfect place! How to guides are meant for showing off examples for using a specific concept, while the full tutorials are more guided content for a new user. If you want to know more, you can read more about the whole how to vs. tutorial here.

I don't recommend any new work is put in the examples, as we're trying to move away from that.

Appreciate the work and look forward to seeing your talk at ROSCon!

@methylDragon methylDragon force-pushed the ch3/trajectory-cache-example branch 4 times, most recently from 9a57708 to 7b64daa Compare July 30, 2024 10:21
@methylDragon methylDragon force-pushed the ch3/trajectory-cache-example branch 2 times, most recently from acd1d23 to 2757b3d Compare July 31, 2024 06:24
Signed-off-by: methylDragon <methylDragon@gmail.com>
sjahr and others added 3 commits August 8, 2024 17:21
Signed-off-by: methylDragon <methylDragon@gmail.com>
Signed-off-by: methylDragon <methylDragon@gmail.com>
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