Skip to content

Commit 1962b20

Browse files
committed
Improve: perception: debug comments
1 parent dc2824c commit 1962b20

2 files changed

Lines changed: 49 additions & 32 deletions

File tree

doc/examples/perception_pipeline/perception_pipeline_tutorial.rst

Lines changed: 43 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,14 @@ 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>`_).
14+
* NOTE-1: 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+
* NOTE-2: As of June 2023, the tutorial code is based on unmerged software changes in the upstream repo. `moveit_resources!181 <https://github.com/ros-planning/moveit_resources/pull/181>`_. Before it's merged, you need to have its source and build by commands e.g. ::
16+
17+
cd ~/ws_moveit/src
18+
git clone https://github.com/130s/moveit_resources.git -b feature-panda-moveit-perception
19+
cd ~/ws_moveit
20+
sudo apt update && rosdep install -r --from-paths . --ignore-src --rosdistro $ROS_DISTRO -y
21+
colcon build --mixin release
1522

1623
Configuration
1724
-------------
@@ -27,20 +34,22 @@ To use the Occupancy Map Updater, it is only necessary to set the appropriate pa
2734
YAML Configuration file (Point Cloud)
2835
+++++++++++++++++++++++++++++++++++++
2936

30-
We will have to generate a YAML configuration file for configuring the 3D sensors. Please see :panda_codedir:`this example file <config/sensors_kinect_pointcloud.yaml>` for processing point clouds.
37+
We will have to generate a YAML configuration file for configuring the 3D sensors. Please see :panda_codedir:`this example file <config/sensors_3d.yaml>` for processing point clouds.
3138

32-
Save this file in the config folder in the robot's moveit_config package with name "sensors_kinect_pointcloud.yaml": ::
39+
Save this file in the config folder in the robot's moveit_config package with name "sensors_3d.yaml": ::
3340

34-
sensors:
35-
- sensor_plugin: occupancy_map_monitor/PointCloudOctomapUpdater
36-
point_cloud_topic: /camera/depth_registered/points
37-
max_range: 5.0
38-
point_subsample: 1
39-
padding_offset: 0.1
40-
padding_scale: 1.0
41-
max_update_rate: 1.0
42-
filtered_cloud_topic: filtered_cloud
43-
ns: kinect
41+
sensors:
42+
- kinect_pointcloud
43+
kinect_pointcloud:
44+
filtered_cloud_topic: filtered_cloud
45+
max_range: 5.0
46+
max_update_rate: 1.0
47+
ns: kinect
48+
padding_offset: 0.1
49+
padding_scale: 0.5
50+
point_cloud_topic: /camera/depth_registered/points
51+
point_subsample: 1
52+
sensor_plugin: occupancy_map_monitor/PointCloudOctomapUpdater
4453

4554
**The general parameters are:**
4655

@@ -66,21 +75,25 @@ Save this file in the config folder in the robot's moveit_config package with na
6675
YAML Configuration file (Depth Map)
6776
+++++++++++++++++++++++++++++++++++
6877

69-
We will have to generate a YAML configuration file for configuring the 3D sensors. An :panda_codedir:`example file for processing depth images <config/sensors_kinect_depthmap.yaml>` can be found in the panda_moveit_config repository as well.
70-
Save this file in the config folder in the robot's moveit_config package with name "sensors_kinect_depthmap.yaml": ::
71-
72-
sensors:
73-
- sensor_plugin: occupancy_map_monitor/DepthImageOctomapUpdater
74-
image_topic: /camera/depth_registered/image_raw
75-
queue_size: 5
76-
near_clipping_plane_distance: 0.3
77-
far_clipping_plane_distance: 5.0
78-
shadow_threshold: 0.2
79-
padding_scale: 4.0
80-
padding_offset: 0.03
81-
max_update_rate: 1.0
82-
filtered_cloud_topic: filtered_cloud
83-
ns: kinect
78+
We will have to generate a YAML configuration file for configuring the 3D sensors. An :panda_codedir:`example file for processing depth images <config/sensors_3d.yaml>` can be found in the panda_moveit_config repository as well.
79+
Save this file in the config folder in the robot's moveit_config package with name "sensors_3d.yaml": ::
80+
81+
sensors:
82+
- kinect_depthimage
83+
kinect_depthimage:
84+
far_clipping_plane_distance: 5.0
85+
filtered_cloud_topic: filtered_cloud
86+
image_topic: /camera/depth_registered/image_raw
87+
max_update_rate: 1.0
88+
near_clipping_plane_distance: 0.3
89+
ns: kinect
90+
padding_offset: 0.03
91+
padding_scale: 4.0
92+
queue_size: 5
93+
sensor_plugin: occupancy_map_monitor/DepthImageOctomapUpdater
94+
shadow_threshold: 0.2
95+
skip_vertical_pixels: 4
96+
skip_horizontal_pixels: 6
8497

8598
**The general parameters are:**
8699

@@ -114,9 +127,9 @@ Add the YAML file to the launch script
114127
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
115128
You will now need to create a *sensor_manager.launch* file in the "launch" directory of your panda_moveit_config directory (e.g. `on github <https://github.com/ros-planning/panda_moveit_config/blob/rolling-devel/launch/sensor_manager.launch.xml>`_) with this sensor information. You will need to add the following line into that file to configure the set of sensor sources for MoveIt to use: ::
116129

117-
<param from="$(find panda_moveit_config)/config/sensors_kinect_pointcloud.yaml" />
130+
<param from="$(find panda_moveit_config)/config/sensors_3d.yaml" />
118131

119-
If you are using depthmap change the name of the yaml file to ``sensors_kinect_depthmap.yaml``.
132+
If you are using depthmap change the name of the yaml file to ``sensors_3d.yaml``.
120133
Note that you will need to input the path to the right file you have created above.
121134

122135
Octomap Configuration

doc/examples/perception_pipeline/src/detect_and_add_cylinder_collision_object_demo.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,15 +303,19 @@ class CylinderSegment : public rclcpp::Node
303303
pcl::fromROSMsg(*input, *cloud);
304304
// Use a passthrough filter to get the region of interest.
305305
// The filter removes points outside the specified range.
306+
RCLCPP_DEBUG(this->get_logger(), "Before passThroughFilter");
306307
passThroughFilter(cloud);
307308
// Compute point normals for later sample consensus step.
308309
pcl::PointCloud<pcl::Normal>::Ptr cloud_normals(new pcl::PointCloud<pcl::Normal>);
310+
RCLCPP_DEBUG(this->get_logger(), "Before computeNormals");
309311
computeNormals(cloud, cloud_normals);
310312
// inliers_plane will hold the indices of the point cloud that correspond to a plane.
311313
pcl::PointIndices::Ptr inliers_plane(new pcl::PointIndices);
312314
// Detect and remove points on the (planar) surface on which the cylinder is resting.
315+
RCLCPP_DEBUG(this->get_logger(), "Before removePlaneSurface");
313316
removePlaneSurface(cloud, inliers_plane);
314317
// Remove surface points from normals as well
318+
RCLCPP_DEBUG(this->get_logger(), "Before extractNormals");
315319
extractNormals(cloud_normals, inliers_plane);
316320
// ModelCoefficients will hold the parameters using which we can define a cylinder of infinite length.
317321
// It has a public attribute |code_start| values\ |code_end| of type |code_start| std::vector<float>\ |code_end|\ .
@@ -325,11 +329,11 @@ class CylinderSegment : public rclcpp::Node
325329
// END_SUB_TUTORIAL
326330
if (cloud->points.empty() || coefficients_cylinder->values.size() != 7)
327331
{
328-
RCLCPP_ERROR(this->get_logger(), "detect_and_add_cylinder_collision_object_demo, can't find the cylindrical component.");
332+
RCLCPP_ERROR(this->get_logger(), "Can't find the cylindrical component. Returning the callback.");
329333
return;
330334
}
331335

332-
RCLCPP_INFO(this->get_logger(), "Detected Cylinder - Adding CollisionObject to PlanningScene");
336+
RCLCPP_INFO(this->get_logger(), "Detected a cylinder - Adding CollisionObject to PlanningScene");
333337

334338
// BEGIN_TUTORIAL
335339
// CALL_SUB_TUTORIAL callback

0 commit comments

Comments
 (0)