Skip to content

Commit af4ad4e

Browse files
committed
Fix: ros2-ified perception tutorial: Many colcon build errors (not all).
1 parent 7d0def4 commit af4ad4e

File tree

13 files changed

+146
-164
lines changed

13 files changed

+146
-164
lines changed

.github/upstream.repos

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ repositories:
77
type: git
88
url: https://github.com/ros-planning/moveit_visual_tools
99
version: ros2
10+
panda_moveit_config:
11+
type: git
12+
url: https://github.com/ros-planning/panda_moveit_config
1013
rosparam_shortcuts:
1114
type: git
1215
url: https://github.com/PickNikRobotics/rosparam_shortcuts

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ add_subdirectory(doc/examples/motion_planning_pipeline)
5959
add_subdirectory(doc/examples/motion_planning_python_api)
6060
add_subdirectory(doc/examples/move_group_interface)
6161
add_subdirectory(doc/examples/moveit_cpp)
62+
add_subdirectory(doc/examples/perception_pipeline)
6263
add_subdirectory(doc/examples/planning_scene)
6364
add_subdirectory(doc/examples/planning_scene_ros_api)
6465
add_subdirectory(doc/examples/realtime_servo)
Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
1-
add_executable(cylinder_segment src/cylinder_segment.cpp)
2-
target_link_libraries(cylinder_segment ${catkin_LIBRARIES})
1+
find_package(PCL REQUIRED)
2+
set(SUBTUTORIAL_DEPENDS
3+
geometry_msgs
4+
pcl_conversions
5+
sensor_msgs
6+
)
7+
foreach(dep IN ITEMS ${SUBTUTORIAL_DEPENDS})
8+
find_package(${dep} REQUIRED)
9+
endforeach()
310

4-
add_executable(bag_publisher_maintain_time src/bag_publisher_maintain_time.cpp)
5-
target_link_libraries(bag_publisher_maintain_time ${catkin_LIBRARIES} ${Boost_LIBRARIES})
11+
include_directories(include ${PCL_INCLUDE_DIRS})
612

7-
install(
8-
TARGETS
9-
bag_publisher_maintain_time
10-
cylinder_segment
11-
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION})
13+
add_executable(cylinder_segment src/cylinder_segment.cpp)
14+
ament_target_dependencies(cylinder_segment
15+
${SUBTUTORIAL_DEPENDS}
16+
${THIS_PACKAGE_INCLUDE_DEPENDS})
1217

13-
install(DIRECTORY launch DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})
18+
install(DIRECTORY bags launch
19+
DESTINATION share/${PROJECT_NAME}
20+
)
-1.56 MB
Binary file not shown.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
rosbag2_bagfile_information:
2+
compression_format: ''
3+
compression_mode: ''
4+
custom_data: {}
5+
duration:
6+
nanoseconds: 0
7+
files:
8+
- duration:
9+
nanoseconds: 0
10+
message_count: 1
11+
path: perception_tutorial.db3
12+
starting_time:
13+
nanoseconds_since_epoch: 1530016169214859695
14+
message_count: 1
15+
relative_file_paths:
16+
- perception_tutorial.db3
17+
starting_time:
18+
nanoseconds_since_epoch: 1530016169214859695
19+
storage_identifier: sqlite3
20+
topics_with_message_count:
21+
- message_count: 1
22+
topic_metadata:
23+
name: /camera/depth_registered/points
24+
offered_qos_profiles: ''
25+
serialization_format: cdr
26+
type: sensor_msgs/msg/PointCloud2
27+
version: 6
Binary file not shown.

doc/examples/perception_pipeline/launch/obstacle_avoidance_demo.launch

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<launch>
2+
<arg name="bagfile" default="$(find-pkg-share moveit2_tutorials)/bags/perception_tutorial.bag" />
3+
<arg name="launchfile_panda"
4+
default="$(find-pkg-share moveit_resources_panda_moveit_config)/launch/demo.launch.py" />
5+
6+
<!-- Play the rosbag that contains the pointcloud data -->
7+
<executable cmd="ros2 bag play -l $(var bagfile)" output="screen" />
8+
9+
<include file="$(var launchfile_panda)" />
10+
11+
<!-- If needed, broadcast static tf for robot root -->
12+
<node pkg="tf2_ros" exec="static_transform_publisher" name="to_panda" args="0 0 0 0 0 0 world panda_link0" />
13+
<node pkg="tf2_ros" exec="static_transform_publisher" name="to_camera" args="0.115 0.427 0.570 0 0.2 1.92 camera_rgb_optical_frame world" />
14+
15+
</launch>

doc/examples/perception_pipeline/perception_pipeline_tutorial.rst

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ Getting Started
1111
---------------
1212
If you haven't already done so, make sure you've completed the steps in :doc:`Getting Started </doc/tutorials/getting_started/getting_started>`.
1313

14+
Particularly, use ``rolling`` for this tutorial as some dependencies may not be available in ``humble`` or earlier (explained in `moveit2_tutorials!700 <https://github.com/ros-planning/moveit2_tutorials/pull/700#issuecomment-1581411304>`_).
15+
1416
Configuration
1517
-------------
1618

@@ -134,6 +136,16 @@ If you set the initial and the final location of the robot in a way that there i
134136
.. image:: obstacle_avoidance.gif
135137
:width: 700px
136138

139+
Before running the software
140+
+++++++++++++++++++++++++++
141+
This tutorial uses `moveit2_tutorials` that depends on `moveit_task_constructor`, whose installer has not yet been available in ros2 yet (progress tracked in `moveit_task_constructor#400 <https://github.com/ros-planning/moveit_task_constructor/issues/400>`_) so you need to get it via source code. Move into your colcon workspace and pull the MoveIt Task Constructor source: ::
142+
143+
cd ~/ws_moveit/src
144+
git clone git@github.com:ros-planning/moveit_task_constructor.git -b ros2
145+
cd ~/ws_moveit
146+
colcon build --mixin release
147+
source ~/ws_moveit/install/setup.bash
148+
137149
Running the Interface
138150
+++++++++++++++++++++
139151
Roslaunch the launch file to run the code directly from moveit_tutorials: ::
@@ -174,9 +186,9 @@ You can follow its status in the `issue tracker <https://github.com/ros-planning
174186

175187
Relevant Code
176188
+++++++++++++
177-
The entire code can be seen :codedir:`here<examples/perception_pipeline>` in the moveit_tutorials GitHub project.
189+
The entire code can be seen :codedir:`here <examples/perception_pipeline>` in the moveit_tutorials GitHub project.
178190

179-
The details regarding the implementation of each of the perception pipeline function have been omitted in this tutorial as they are well documented `here <http://wiki.ros.org/pcl/Tutorials>`_.
191+
The details regarding the implementation of each of the perception pipeline function have been omitted in this tutorial as they are well documented on `ros1 wiki <http://wiki.ros.org/pcl/Tutorials>`_.
180192

181193
.. |br| raw:: html
182194

doc/examples/perception_pipeline/src/bag_publisher_maintain_time.cpp

Lines changed: 0 additions & 82 deletions
This file was deleted.

0 commit comments

Comments
 (0)