-
Notifications
You must be signed in to change notification settings - Fork 246
Refactored perception pipeline tutorial from ros1 to ros 2 #906
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
Merged
Merged
Changes from 3 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
39c5861
Refactored perception pipeline tutorial from ros1 to ros 2
CihatAltiparmak 1351c6b
Deleted unnecessary images in perception pipeline
CihatAltiparmak cf1607e
Merge branch 'main' into main
CihatAltiparmak e7eec45
Changed demo video and some CmakeList.txt modification
CihatAltiparmak 468da6c
Merge branch 'main' into main
sjahr fb8b83b
Merge branch 'main' into main
sjahr 98222bc
Merge branch 'main' into main
sjahr 9fc11bf
Update doc/examples/perception_pipeline/perception_pipeline_tutorial.rst
CihatAltiparmak 42a3814
Update doc/examples/perception_pipeline/perception_pipeline_tutorial.rst
CihatAltiparmak d68f8b4
Update doc/examples/perception_pipeline/perception_pipeline_tutorial.rst
CihatAltiparmak 11fba3e
Update doc/examples/perception_pipeline/perception_pipeline_tutorial.rst
CihatAltiparmak bc1504d
Applied the suggestions in the review
CihatAltiparmak a9df992
Modify the tutorial for depth image updater
CihatAltiparmak 06cd7b4
Merge branch 'main' into main
CihatAltiparmak c5383b5
Added the link to pre-recorded bag file
CihatAltiparmak f36db67
Merge branch 'main' into main
CihatAltiparmak 5e68edf
Update doc/examples/perception_pipeline/launch/perception_pipeline_de…
CihatAltiparmak 19856d1
Update doc/examples/perception_pipeline/launch/perception_pipeline_de…
CihatAltiparmak 5865b15
Update doc/examples/perception_pipeline/launch/perception_pipeline_de…
CihatAltiparmak cb75456
Update doc/examples/perception_pipeline/perception_pipeline_tutorial.rst
CihatAltiparmak 4c28fc1
Update doc/examples/perception_pipeline/launch/perception_pipeline_de…
CihatAltiparmak aad435d
Applied suggestions in review and pre-fix
CihatAltiparmak File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,17 @@ | ||
| add_executable(cylinder_segment src/cylinder_segment.cpp) | ||
| target_link_libraries(cylinder_segment ${catkin_LIBRARIES}) | ||
| install(DIRECTORY urdf | ||
| DESTINATION share/${PROJECT_NAME}) | ||
|
|
||
| add_executable(bag_publisher_maintain_time src/bag_publisher_maintain_time.cpp) | ||
| target_link_libraries(bag_publisher_maintain_time ${catkin_LIBRARIES} ${Boost_LIBRARIES}) | ||
| install(DIRECTORY launch | ||
| DESTINATION share/${PROJECT_NAME}) | ||
|
|
||
| install( | ||
| TARGETS | ||
| bag_publisher_maintain_time | ||
| cylinder_segment | ||
| DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}) | ||
| install(DIRECTORY meshes | ||
| DESTINATION share/${PROJECT_NAME}) | ||
|
|
||
| install(DIRECTORY launch DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}) | ||
| install(DIRECTORY config | ||
CihatAltiparmak marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| DESTINATION share/${PROJECT_NAME}) | ||
|
|
||
| install(DIRECTORY worlds | ||
| DESTINATION share/${PROJECT_NAME}) | ||
|
|
||
| install(DIRECTORY rviz2 | ||
| DESTINATION share/${PROJECT_NAME}) | ||
Binary file not shown.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| sensors: | ||
| - camera_1_pointcloud | ||
| - camera_2_pointcloud | ||
| camera_1_pointcloud: | ||
| sensor_plugin: occupancy_map_monitor/PointCloudOctomapUpdater | ||
| point_cloud_topic: /camera_1/points | ||
| max_range: 5.0 | ||
| point_subsample: 1 | ||
| padding_offset: 0.1 | ||
| padding_scale: 1.0 | ||
| max_update_rate: 1.0 | ||
| filtered_cloud_topic: /camera_1/filtered_points | ||
| camera_2_pointcloud: | ||
| sensor_plugin: occupancy_map_monitor/PointCloudOctomapUpdater | ||
| point_cloud_topic: /camera_2/points | ||
| max_range: 5.0 | ||
| point_subsample: 1 | ||
| padding_offset: 0.1 | ||
| padding_scale: 1.0 | ||
| max_update_rate: 1.0 | ||
| filtered_cloud_topic: /camera_2/filtered_points |
Binary file not shown.
Binary file added
BIN
+197 KB
doc/examples/perception_pipeline/images/perception_pipeline_demo_gazebo_screen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+411 KB
doc/examples/perception_pipeline/images/perception_pipeline_demo_rviz_screen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+162 KB
...les/perception_pipeline/images/perception_pipeline_depth_camera_environment.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
153 changes: 153 additions & 0 deletions
153
doc/examples/perception_pipeline/launch/depth_camera_environment.launch.py
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,153 @@ | ||
| import os | ||
| from ament_index_python.packages import get_package_share_directory | ||
| from launch import LaunchDescription | ||
| from launch.substitutions import Command | ||
| from launch_ros.substitutions import FindPackageShare | ||
| from launch_ros.actions import Node | ||
| from launch.actions import IncludeLaunchDescription | ||
| from launch.substitutions import PathJoinSubstitution | ||
| import math | ||
|
|
||
|
|
||
| def generate_launch_description(): | ||
| urdf_file = os.path.join( | ||
| get_package_share_directory("moveit2_tutorials"), | ||
| "urdf/realsense_d435/camera.urdf.xacro", | ||
| ) | ||
|
|
||
| # The list presents the pose in euler coordinates ordered x, y, z, yaw, pitch, roll respectively. | ||
| camera_1_pose = ["-1", "-1", "0", f"{math.pi/2}", "0.0", "0.0"] | ||
| camera_2_pose = ["-1", "1", "0", f"-{math.pi/2}", "0.0", "0.0"] | ||
|
|
||
| # It is necessary for gazebo spawner to use the description of camera_1 in gazebo environment | ||
| camera_1_robot_state_publisher_node = Node( | ||
| package="robot_state_publisher", | ||
| executable="robot_state_publisher", | ||
| name="robot_state_publisher", | ||
| output="screen", | ||
| parameters=[ | ||
| { | ||
| "use_sim_time": True, | ||
| "robot_description": Command( | ||
| [f"xacro {urdf_file}", " camera_name:='camera_1'"] | ||
| ), | ||
| } | ||
| ], | ||
| remappings=[ | ||
| ("robot_description", "/camera_1/robot_description"), | ||
| ], | ||
| ) | ||
|
|
||
| # It is necessary for spawning camera_1 in gazebo environment | ||
| camera_1_gazebo_spawner_node = Node( | ||
| package="gazebo_ros", | ||
| executable="spawn_entity.py", | ||
| arguments=[ | ||
| "-entity", | ||
| "mr_camera", | ||
| "-topic", | ||
| "/camera_1/robot_description", | ||
| "-x", | ||
| camera_1_pose[0], | ||
| "-y", | ||
| camera_1_pose[1], | ||
| "-z", | ||
| camera_1_pose[2], | ||
| "-Y", | ||
| camera_1_pose[3], | ||
| "-P", | ||
| camera_1_pose[4], | ||
| "-R", | ||
| camera_1_pose[5], | ||
| ], | ||
| output="screen", | ||
| ) | ||
|
|
||
| # It is necessary to make transformation between world frame and camera frames enable later. | ||
| camera_1_tf_from_world_publisher_node = Node( | ||
| package="tf2_ros", | ||
| executable="static_transform_publisher", | ||
| name="static_transform_publisher", | ||
| output="log", | ||
| arguments=[*camera_1_pose, "world", "camera_1_base_link"], | ||
| ) | ||
|
|
||
| # It is necessary for gazebo spawner to use the description of camera_2 in gazebo environment | ||
| camera_2_gazebo_spawner_node = Node( | ||
| package="robot_state_publisher", | ||
| executable="robot_state_publisher", | ||
| name="robot_state_publisher2", | ||
| output="screen", | ||
| parameters=[ | ||
| { | ||
| "use_sim_time": True, | ||
| "robot_description": Command( | ||
| [f"xacro {urdf_file}", " camera_name:='camera_2'"] | ||
| ), | ||
| } | ||
| ], | ||
| remappings=[ | ||
| ("robot_description", "/camera_2/robot_description"), | ||
| ], | ||
| ) | ||
|
|
||
| # It is necessary for spawning camera_2 in gazebo environment | ||
| camera_2_robot_state_publisher_node = Node( | ||
| package="gazebo_ros", | ||
| executable="spawn_entity.py", | ||
| name="spawn2", | ||
| arguments=[ | ||
| "-entity", | ||
| "mr_camera2", | ||
| "-topic", | ||
| "/camera_2/robot_description", | ||
| "-x", | ||
| camera_2_pose[0], | ||
| "-y", | ||
| camera_2_pose[1], | ||
| "-z", | ||
| camera_2_pose[2], | ||
| "-Y", | ||
| camera_2_pose[3], | ||
| "-P", | ||
| camera_2_pose[4], | ||
| "-R", | ||
| camera_2_pose[5], | ||
| ], | ||
| output="screen", | ||
| ) | ||
|
|
||
| # It is necessary to make transformation between world frame and camera frames enable later. | ||
| camera_2_tf_from_world_publisher_node = Node( | ||
| package="tf2_ros", | ||
| executable="static_transform_publisher", | ||
| name="static_transform_publisher", | ||
| output="log", | ||
| arguments=[*camera_2_pose, "world", "camera_2_base_link"], | ||
| ) | ||
|
|
||
| # It is necessary to open previously created gazebo world for perception pipeline demo. | ||
| gazebo_launch = IncludeLaunchDescription( | ||
| PathJoinSubstitution( | ||
| [FindPackageShare("gazebo_ros"), "launch", "gazebo.launch.py"] | ||
| ), | ||
| launch_arguments={ | ||
| "world": os.path.join( | ||
| get_package_share_directory("moveit2_tutorials"), | ||
| "worlds", | ||
| "perception_pipeline_demo.world", | ||
| ), | ||
| }.items(), | ||
| ) | ||
|
|
||
| return LaunchDescription( | ||
| [ | ||
| camera_1_robot_state_publisher_node, | ||
| camera_1_gazebo_spawner_node, | ||
| camera_1_tf_from_world_publisher_node, | ||
| camera_2_robot_state_publisher_node, | ||
| camera_2_gazebo_spawner_node, | ||
| camera_2_tf_from_world_publisher_node, | ||
| gazebo_launch, | ||
| ] | ||
| ) |
7 changes: 0 additions & 7 deletions
7
doc/examples/perception_pipeline/launch/detect_and_add_cylinder_collision_object_demo.launch
This file was deleted.
Oops, something went wrong.
11 changes: 0 additions & 11 deletions
11
doc/examples/perception_pipeline/launch/obstacle_avoidance_demo.launch
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.