@@ -61,6 +61,7 @@ This repository is licensed under the Apache 2.0, see [LICENSE](./LICENSE) for d
6161- [ joystick_control] ( #joystick_control )
6262- [ object_tracking] ( #object_tracking )
6363- [ line_follower] ( #line_follower )
64+ - [ camera_line_follower] ( #camera_line_follower )
6465- [ SLAM] ( #slam )
6566- [ direction_controller] ( #direction_controller )
6667
@@ -162,7 +163,7 @@ $ ros2 launch raspimouse_ros2_examples object_tracking.launch.py video_device:=/
162163
163164This sample publishes two topics: ` camera/color/image_raw ` for the camera image and ` result_image ` for the object detection image.
164165These images can be viewed with [ RViz] ( https://index.ros.org/r/rviz/ )
165- or [ rqt_image_view] ( https://index.ros.org/doc/ros2/Tutorials/RQt-Overview-Usage / ) .
166+ or [ rqt_image_view] ( https://index.ros.org/p/rqt_image_view / ) .
166167
167168** Viewing an image may cause the node to behave unstable and not publish cmd_vel or image topics.**
168169
@@ -247,87 +248,81 @@ void Follower::publish_cmdvel_for_line_following(void)
247248
248249[back to example list](#how-to-use-examples)
249250
250- ---
251+ ---
251252
252- ### SLAM
253+ ### camera_line_follower
253254
254- <img src=https://rt-net.github.io/images/raspberry-pi-mouse/slam_toolbox_ros2 .png width=500 />
255+ <img src=https://rt-net.github.io/images/raspberry-pi-mouse/mouse_camera_line_trace_2 .png width=500 />
255256
256- This is an example to use LiDAR and [slam_toolbox](https://github.com/SteveMacenski/slam_toolbox) for SLAM (Simultaneous Localization And Mapping) .
257+ This is an example for line following by RGB camera .
257258
258259#### Requirements
259260
260- - LiDAR
261- <!-- - [URG-04LX-UG01](https://www.rt-shop.jp/index.php?main_page=product_info&cPath=1348_1296&products_id=2816&language=en)
262- - [RPLIDAR A1](https://www.slamtec.com/en/Lidar/A1) -->
263- - [LDS-01](https://www.rt-shop.jp/index.php?main_page=product_info&cPath=1348_5&products_id=3676&language=en)
264- - [LiDAR Mount](https://www.rt-shop.jp/index.php?main_page=product_info&cPath=1299_1395&products_id=3867&language=en)
265- - Joystick Controller (Optional)
266-
261+ - Web camera
262+ - [Logicool HD WEBCAM C310N](https://www.logicool.co.jp/ja-jp/product/hd-webcam-c310n)
263+ - Camera mount
264+ - [Raspberry Pi Mouse Option kit No.4 \[Webcam mount\]](https://www.rt-shop.jp/index.php?main_page=product_info&cPath=1299_1395&products_id=3584&language=en)
265+
267266#### Installation
268267
269- Install a LiDAR to the Raspberry Pi Mouse.
268+ Install a camera mount and a web camera to Raspberry Pi Mouse, then connect the camera to the Raspberry Pi.
270269
271- <!-- - URG-04LX-UG01
272- - <img src="https://github.com/rt-net/raspimouse_ros_examples/blob/images/mouse_with_urg.JPG" width=500 />
273- - RPLIDAR A1
274- - <img src="https://github.com/rt-net/raspimouse_ros_examples/blob/images/mouse_with_rplidar.png" width=500 /> -->
275- - LDS-01
276- - <img src=https://rt-net.github.io/images/raspberry-pi-mouse/mouse_with_lds01.JPG width=500 />
277-
278270#### How to use
279271
280- Launch nodes on Raspberry Pi Mouse with the following command:
272+ Then, launch nodes with the following command:
281273
282274```sh
283- # LDS
284- $ ros2 launch raspimouse_ros2_examples mouse_with_lidar.launch.py lidar:=lds
275+ $ ros2 launch raspimouse_ros2_examples camera_line_follower.launch.py video_device:=/dev/video0
285276```
286277
287- Next, launch ` teleop_joy.launch.py ` to control Raspberry Pi Mouse with the following command:
288-
289- ``` sh
290- # Use DUALSHOCK 3
291- $ ros2 launch raspimouse_ros2_examples teleop_joy.launch.py joydev:=" /dev/input/js0" joyconfig:=dualshock3 mouse:=false
292- ```
278+ Place Raspberry Pi Mouse on the line and press SW2 to start line following.
293279
294- Then, launch the slam_toolbox package (on a remote computer recommend) with the following command:
280+ Press SW0 to stop the following.
295281
296- ``` sh
297- $ ros2 launch raspimouse_ros2_examples slam.launch.py
298- ```
299-
300- After moving Raspberry Pi Mouse and making a map, run a node to save the map with the following command:
282+ This sample publishes two topics: ` camera/color/image_raw ` for the camera image and ` result_image ` for the object detection image.
283+ These images can be viewed with [ RViz] ( https://index.ros.org/r/rviz/ )
284+ or [ rqt_image_view] ( https://index.ros.org/p/rqt_image_view/ ) .
301285
302- ``` sh
303- $ mkdir ~ /maps
304- $ ros2 run nav2_map_server map_saver_cli -f ~ /maps/mymap --ros-args -p save_map_timeout:=10000.0
305- ```
286+ ** Viewing an image may cause the node to behave unstable and not publish cmd_vel or image topics.**
306287
307- #### Configure SLAM parameters
288+ <img src= https://rt-net.github.io/images/raspberry-pi-mouse/camera_line_trace.png width=500 />
308289
309- Edit [ ./config/mapper_params_offline.yaml ] ( ./config/mapper_params_offline.yaml ) to configure parameters of [ slam_toolbox ] ( https://github.com/SteveMacenski/slam_toolbox ) package.
290+ #### Parameters
310291
311- #### Configure Odometry calculation
292+ - ` max_brightness `
293+ - Type: ` int `
294+ - Default: 90
295+ - Maximum threshold value for image binarisation.
296+ - ` min_brightness `
297+ - Type: ` int `
298+ - Default: 0
299+ - Minimum threshold value for image binarisation.
300+ - ` max_linear_vel `
301+ - Type: ` double `
302+ - Default: 0.05
303+ - Maximum linear velocity.
304+ - ` max_angular_vel `
305+ - Type: ` double `
306+ - Default: 0.8
307+ - Maximum angular velocity.
308+ - ` area_threthold `
309+ - Type: ` double `
310+ - Default: 0.20
311+ - Threshold value of the area of the line to start following.
312312
313- Edit [ mouse.yml] ( ./config/mouse.yml ) to set ` use_pulse_counters ` to ` true ` (default: ` false ` ) then the ` raspimouse ` node calculate the odometry (` /odom ` ) from motor control pulse counts.
313+ ``` sh
314+ ros2 param set /camera_follower max_brightness 80
315+ ```
314316
315- This improves the accuracy of self-localization.
317+ [ back to example list ] ( #how-to-use-examples )
316318
317- ``` yaml
318- raspimouse :
319- ros__parameters :
320- odometry_scale_left_wheel : 1.0
321- odometry_scale_right_wheel : 1.0
322- use_light_sensors : true
323- use_pulse_counters : true
324- ` ` `
319+ ---
325320
326- <!-- #### Videos
321+ ### SLAM
327322
328- [](https://youtu.be/gWozU47UqVE)
323+ <img src= https ://rt-net.github.io/images/raspberry-pi-mouse/slam_toolbox_ros2.png width=500 />
329324
330- [](https://youtu.be/hV68UqAntfo) -->
325+ SLAM and Navigation examples for Raspberry Pi Mouse is [ here ] ( https ://github. com/rt-net/raspimouse_slam_navigation_ros2 ) .
331326
332327[ back to example list] ( #how-to-use-examples )
333328
0 commit comments