You are on page 1of 18

RoboSot Parking Setting Up Guide

Arif Rahman
arifrahman.maar@gmail.com

Latest version is here:


https://docs.google.com/presentation/d/1mz8CHbOW8u0OpWocSsB
KZvK8hTy-rC_joa-eGlZxLZk/edit?usp=sharing
2
Flow diagram
Follow line

Parking
sign?

Dotted Go into Go out of


lines? parking parking

3
Get the code
1. Copy turtlebot3_fira_parking.launch to
catkin_ws/src/turtlebot3_simulations/turtlebot3_gazebo/launch

2. Copy folder course_fira to


catkin_ws/src/turtlebot3_simulations/turtlebot3_gazebo/models/turtlebot3_autorace

3. Copy turtlebot3_fira_parking.world into


catkin_ws/src/turtlebot3_simulations/turtlebot3_gazebo/worlds

4. Run catkin make


$ cd ~/catkin_ws
$ catkin_make

4
Get the code
5. Copy projection (fira_sim).yaml into
catkin_ws/src/turtlebot3_autorace/turtlebot3_autorace_camera/calibration/extrinsic_calibrat
ion/
Make a backup copy of your current projection.yaml file.
Then change the name of projection (fira_sim).yaml to projection.yaml

6. Copy lane (fira_sim).yaml into


catkin_ws/src/turtlebot3_autorace/turtlebot3_autorace_detect/param/lane/

Make a backup copy of your current lane.yaml file.


Then change the name of lane (fira_sim).yaml to lane.yaml

5
Running the simulation
Terminal 1:
$ roslaunch turtlebot3_gazebo turtlebot3_fira_parking.launch

Terminal 2:
$ export GAZEBO_MODE=true
$ export AUTO_IN_CALIB=action
$ roslaunch turtlebot3_autorace_camera
turtlebot3_autorace_intrinsic_camera_calibration.launch

Terminal 3:
$ export AUTO_EX_CALIB=action
$ export AUTO_DT_CALIB=action
$ export TURTLEBOT3_MODEL=burger
$ roslaunch turtlebot3_autorace_core turtlebot3_autorace_core.launch
6
Running the simulation
Terminal 4:
$ rostopic pub -1 /core/decided_mode std_msgs/UInt8 "data: 2"

Ref: http://emanual.robotis.com/docs/en/platform/turtlebot3/autonomous_driving/#autorace-with-gazebo

7
Running on the real robot
Terminal 1 (On remote PC):
$ roslaunch turtlebot3_gazebo turtlebot3_fira_parking.launch

If using PiCam:
Terminal 2 (On robot):
$ export GAZEBO_MODE=false
$ export AUTO_IN_CALIB=action
$ roslaunch turtlebot3_autorace_camera
turtlebot3_autorace_intrinsic_camera_calibration.launch

If using webcam:
On robot:
$ rosrun usb_cam usb_cam_node
On laptop:
$ rosrun image_transport republish compressed in:=/usb_cam/image_raw raw out:=/camera/image

8
Running on the real robot
Terminal 3 (On remote PC):
$ export AUTO_EX_CALIB=action
$ export AUTO_DT_CALIB=action
$ export TURTLEBOT3_MODEL=burger
$ roslaunch turtlebot3_autorace_core turtlebot3_autorace_core.launch

Terminal 4 (On remote PC):


$ rostopic pub -1 /core/decided_mode std_msgs/UInt8 "data: 2"

Ref: http://emanual.robotis.com/docs/en/platform/turtlebot3/autonomous_driving/#autorace-with-gazebo

9
Extrinsic camera calibration
Terminal 1:
$ roscore

Terminal 2:
$ export GAZEBO_MODE=true
$ export AUTO_IN_CALIB=action
$ roslaunch turtlebot3_autorace_camera
turtlebot3_autorace_intrinsic_camera_calibration.launch

Terminal 3:
$ export AUTO_EX_CALIB=calibration
$ roslaunch turtlebot3_autorace_camera
turtlebot3_autorace_extrinsic_camera_calibration.launch

10
Extrinsic camera calibration
Terminal 4:
$ rqt

Then select:
Plugins > Configuration > Dynamic Reconfigure (select /camera/image_projection)
Plugins > Visualization > Image View (topic /camera/image_extrinsic_calib/compressed )
Plugins > Visualization > Image View (topic /camera/image_projected_compensated )

1. Adjust the image projection parameters (top_x, top_y, bottom_x & bottom_y) such that in the image
/camera/image_projected_compensated you can see the two lines are in parallel.
2. Test at all parts of the track.
3. Overwrite each values on to
turtlebot3_autorace_camera/calibration/extrinsic_calibration/projection.yaml

11
Settings for Simulation
Terminal 1:
$ roscore

Terminal 2:
$ export GAZEBO_MODE=true
$ export AUTO_IN_CALIB=action
$ roslaunch turtlebot3_autorace_camera
turtlebot3_autorace_intrinsic_camera_calibration.launch

Terminal 3:
$ export AUTO_EX_CALIB=action
$ roslaunch turtlebot3_autorace_camera
turtlebot3_autorace_extrinsic_camera_calibration.launch

12
Settings for Real Robot
Terminal 1 (on Remote PC):
$ roscore

Terminal 2 (on Robot):


$ roslaunch turtlebot3_autorace_camera turtlebot3_autorace_camera_pi.launch

Terminal 3 (on Robot):


$ export AUTO_IN_CALIB=action
$ roslaunch turtlebot3_autorace_camera
turtlebot3_autorace_intrinsic_camera_calibration.launch

Terminal 4 (on Remote PC):


$ export AUTO_EX_CALIB=action
$ roslaunch turtlebot3_autorace_camera
turtlebot3_autorace_extrinsic_camera_calibration.launch 13
Lane Detection - Calibration
Terminal 4:
$ export AUTO_DT_CALIB=calibration
$ roslaunch turtlebot3_autorace_detect
turtlebot3_autorace_detect_lane.launch

Terminal 5:
$ rqt
Then select:
Plugins > Configuration > Dynamic Reconfigure (select /detect_lane)
Plugins > Visualization > Image View (topic /detect/image_yellow_lane_marker/compressed)
Plugins > Visualization > Image View (topic /detect/image_lane/compressed)
Plugins > Visualization > Image View (topic /detect/image_white_lane_marker/compressed)

1. Adjust the white and yellow HSV values so that it only detects their colour.
2. Test at all parts of the track. 14
3. Overwrite the values on to turtlebot3_autorace_detect/param/lane/lane.yaml
Lane Detection - Test
Terminal 4:
$ export AUTO_DT_CALIB=action
$ roslaunch turtlebot3_autorace_detect
turtlebot3_autorace_detect_lane.launch

Terminal 5:
$ roslaunch turtlebot3_autorace_control turtlebot3_autorace_control_lane.launch

15
Traffic Sign Detection - Setup
Terminal 4:

$ rqt

Select:

Plugins > Visualization > Image View (topic /camera/image_compensated )

1. Place the robot in front of the sign to be detected, and take a screen shot of the camera view.

2. Edit the image file to only show the sign image.

3. Save this image as parking.png in


catkin_ws/src/turtlebot3_autorace/turtlebot3_autorace_detect/file/detect_sign

Ref: http://emanual.robotis.com/docs/en/platform/turtlebot3/autonomous_driving/#tutorials-52-traffic-sign
16
Traffic Sign Detection - Test
Terminal 4:

$ rqt

Select:

Plugins > Visualization > Image View (topic /detect/image_traffic_sign/compressed )

Terminal 5:

$ roslaunch turtlebot3_autorace_detect turtlebot3_autorace_detect_sign.launch

Move the robot in front of the sign, and test the detection result.

17
18

You might also like