- Ubuntu 20.04
- ROS Noetic
- OpenCV 4
- PCL 1.10
- theta_s_ros
sudo apt install ros-noetic-realsense2-camera \
ros-noetic-rgbd-launch \
ros-noetic-image-transport \
ros-noetic-image-transport-plugins
cd catkin_ws/src
git clone https://github.com/RenFukats/color_detector.git
cd ..
rosdep install -i --from-paths src
catkin build
- /equirectangular/image_raw (sensor_msgs/Image)
- /camera/depth_registered/points (sensor_msgs/PointCloud2)
- /target/angle (color_detector_msg/TargetAngleList)
- /target/position (color_detector_msg/TargetPosition)
- dynamic reconfigure: only_publish_mask = true
- /color_detector/masked/$COLOR/cloud (sensor_msgs/PointCloud2)
- realsense
- /color_detector/masked/$COLOR/image_raw (sensor_msgs/Image)
- theta s
- /color_detector/masked/$COLOR/cloud (sensor_msgs/PointCloud2)
- dynamic reconfigure: publish_target = true
- /color_detector/target/$COLOR/cloud (sensor_msgs/PointCloud2)
- realsense
- /color_detector/target/$COLOR/image_raw (sensor_msgs/Image)
- theta s
- /color_detector/target/$COLOR/cloud (sensor_msgs/PointCloud2)
Theta S in live mode and then
roslaunch color_detector run_color_detector_node.launch
- is_bag : use bagfile
- use_colors : enable colors ex) bash
roslaunch color_detector run_color_detector_node.launch is_bag:=true use_colors:=blue
yaml
<include file="$(find color_detector)/launch/run_color_detector_node.launch" >
<arg name="is_bag" default="true" />
<arg name="use_colors" default="green,red,blue" />
</include>
- terminal 1
rviz
- Fixed Frame
map
->camera_color_optical_frame
- Add topics
- Fixed Frame
- terminal 2
rosrun rqt_reconfigure rqt_reconfigure
- Optimize the parameters.
- Write parameters to
~/catkin_ws/src/color_detector/color_detector_params/config/config.yaml
TOLERANCE
: If the distance between each point is less thanTOLERANCE
, they are in the same group.MIN_CLUSTER_SIZE
: Do not publish if the size of the target cluster is less thanMIN_CLUSTER_SIZE
MAX_CLUSTER_SIZE
: If the number of masked point clouds is more thanMAX_CLUSTER_SIZE
, reduce the number of points to be less thanMAX_CLUSTER_SIZE
to improve the computational complexity.