Chuanglebo Robot Learning

Article Directory

Explain

Shortcut keys

Start a new terminal

Ctrl+Shift+T

Jump to Project Directory

roscd clbrobot/

Code Location

Chassis code

/home/riki/catkin_ws/src/rikirobot_project/rikirobot/src

Initial use

Configure the IP address of the connection

Open the personal environment variable file to modify the IP address of the connection ROS

$ gedit ~/.bashrc

Find the next line of text and modify the IP address

export ROS_MASTER_URI=http://192.168.43.155:11311

Open chassis to run program

Sign in

Password: 123456

$ ssh -l clbrobot 192.168.43.155

Function

$ roslaunch clbrobot bringup.launch

Open Keyboard Control Program

$ rosrun teleop_twist_keyboard teleop_twist_keyboard.py

Open debugging window

Open Software

$ rosrun rviz rviz

Open Coordinate Configuration

Open odometry.rviz in the following directory to monitor the location of the robot in real time

CLB@CLB:~/catkin_ws/src/rikirobot_project/rikirobot/rviz$ ls
auto_slam.rviz  laser.rviz  multi_goal.rviz  navigate.rviz  odometry.rviz  slam.rviz
CLB@CLB:~/catkin_ws/src/rikirobot_project/rikirobot/rviz$ pwd
/home/riki/catkin_ws/src/rikirobot_project/rikirobot/rviz

Data Correction

IMU Auto Correction

Enter Directory

CLB@CLB:~/catkin_ws/src/rikirobot_project/rikirobot/param/imu$ pwd
/home/riki/catkin_ws/src/rikirobot_project/rikirobot/param/imu
CLB@CLB:~/catkin_ws/src/rikirobot_project/rikirobot/param/imu$ ls
imu_calib.yaml

configuration file

$ gedit imu_calib.yaml

Viewing Accuracy

$ rostopic echo /imu/data

Automatic Calibration

$ rosrun imu_calib do_calib

Angular Velocity Correction

Calculation of Scale Factor

Angle ratio is therefore used for chassis data storage

If you turn 5 degrees more, that is (5+360)/360=1.013

Sign in

$ ssh -l clbrobot 192.168.43.155

Run python file

$ rosrun rikirobot_nav calibrate_angular.py

Run Configurator on Virtual Machine

No need to log on to ros

$ rosrun rqt_reconfigure rqt_reconfigure

Check start_test for 360 rotation test to test how much the robot actually rotates and record it

Modify Profile

Log in and open the configuration file for the chassis

clbrobot@clbrobot:~$ roscd clbrobot/
clbrobot@clbrobot:~/catkin_ws/src/clbrobot_project/clbrobot$ cd launch/
clbrobot@clbrobot:~/catkin_ws/src/clbrobot_project/clbrobot/launch$ gedit bringup.launch

Find the configuration item for angular_scale and modify it to the measured data

<node pkg="imu_filter_madgwick" type="imu_filter_node" name="imu_filter_madgwick" output="screen" respawn="false" >
        <param name="fixed_frame" value="base_footprint" />
        <param name="use_mag" value="fasle" />
        <param name="publish_tf" value="false" />
        <param name="use_magnetic_field_msg" value="fasle" />
        <param name="world_frame" value="enu" />
        <param name="orientation_stddev" value="0.05" />
        <param name="angular_scale" value="1.014" />
</node>

Line Speed Correction

Sign in

$ ssh -l clbrobot 192.168.43.155

Run python file

$ rosrun rikirobot_nav calibrate_linear.py

Run Configurator on Virtual Machine

No need to log on to ros

$ rosrun rqt_reconfigure rqt_reconfigure

Check start_test for a 1-meter forward test to test how long the robot actually took and record it

Modify Profile

Log in and open the configuration file for the chassis

clbrobot@clbrobot:~$ roscd clbrobot/
clbrobot@clbrobot:~/catkin_ws/src/clbrobot_project/clbrobot$ cd launch/
clbrobot@clbrobot:~/catkin_ws/src/clbrobot_project/clbrobot/launch$ gedit bringup.launch

Find the linear_scale configuration item and modify it to the measured data

<node pkg="clbrobot" name="riki_base_node" type="riki_base_node">
        <param name="linear_scale" type="double" value="0.88" />
</node>

Dynamic debugging of PID parameters

$ rosrun riki_pid pid_configure

$ rosrun rqt_reconfigure rqt_reconfigure

$ rosrun teleop_twist_keyboard

Creation and Use of SLAM Maps

Map Creation Map

Log in and open chassis program

$ roslaunch clbrobot bringup.launch

Log on and turn on Radar

$ roslaunch clbrobot lidar_slam.launch

Open debugging window without logging in

$ rosrun rviz rviz

load file

Load slam.rviz file on software

CLB@CLB:~/catkin_ws/src/rikirobot_project/rikirobot/rviz$ pwd
/home/riki/catkin_ws/src/rikirobot_project/rikirobot/rviz
CLB@CLB:~/catkin_ws/src/rikirobot_project/rikirobot/rviz$ ls
auto_slam.rviz  multi_goal.rviz  odometry.rviz
laser.rviz      navigate.rviz    slam.rviz

Remarks:

Middle mouse button to drag map

Mouse wheel zooms in and out

Right mouse button to zoom in and out

Left mouse button rotates

No login required to start keyboard control

$ rosrun teleop_twist_keyboard teleop_twist_keyboard.py

Note: Instead of using a keyboard, you can directly select 2D Pose Estinate in rviz to get the robot to the specified location to build a map.

Automatically build maps by selecting areas

Open Auto-Build Map

Logon Start Required

$ roslaunch clbrobot auto_slam.launch
Open Debugging Tool
$ rosrun rviz rviz

Load auto_slam.rviz file on software

CLB@CLB:~/catkin_ws/src/rikirobot_project/rikirobot/rviz$ pwd
/home/riki/catkin_ws/src/rikirobot_project/rikirobot/rviz
CLB@CLB:~/catkin_ws/src/rikirobot_project/rikirobot/rviz$ ls
auto_slam.rviz  multi_goal.rviz  odometry.rviz
laser.rviz      navigate.rviz    slam.rviz

After opening the debugging tool, select Publish Point with the left mouse button, set a point in the map, select Publish Point, and set the next point until a closed area is formed, then press a point, and the robot will automatically build the map to its location

Hector algorithm for building maps

Log in and open chassis program
$ roslaunch clbrobot bringup.launch
Open hector slam node

Logon Required

$roslaunch clbrobot hector_slam.launch
Open Debugging Tool

No login required

$ rosrun rviz rviz

Load slam.rviz file on software

Open Keyboard
$ rosrun teleop_twist_keyboard teleop_twist_keyboard.py

Mobile Robot Complete Composition

Be careful:

Set both line and angular speeds to around 0.2, too fast may cause map building failure

Karto algorithm for building maps

Log in and open chassis program
$ roslaunch clbrobot bringup.launch
Open karto slam node

Logon Required

$roslaunch clbrobot karto_slam.launch

Open Debugging Tool

No login required

$ rosrun rviz rviz

Load slam.rviz file on software

Open Keyboard
$ rosrun teleop_twist_keyboard teleop_twist_keyboard.py

Mobile Robot Complete Composition

Save Map

Save map in ROS after login

Enter directory

clbrobot@clbrobot:~$ roscd clbrobot/
clbrobot@clbrobot:~/catkin_ws/src/clbrobot_project/clbrobot$ cd maps/
clbrobot@clbrobot:~/catkin_ws/src/clbrobot_project/clbrobot/maps$ ls
cartographer_map.sh  house.pgm  house.yaml  map.bag.pbstream  map.pgm  map.sh  map.yaml

Give script permissions

$ chmod 777 map.sh 

Execute scripts to save maps

$ ./map.sh 
[ INFO] [1455211385.464521985]: Waiting for the map
[ INFO] [1455211385.699357061]: Received a 1984 X 1984 map @ 0.050 m/pix
[ INFO] [1455211385.699489266]: Writing map occupancy data to house.pgm
[ INFO] [1455211386.047259404]: Writing map occupancy data to house.yaml
[ INFO] [1455211386.047918398]: Done

Start Navigation

Log in and reopen the chassis program

$ roslaunch clbrobot bringup.launch

Log in and open the navigation

$ roslaunch clbrobot navigate.launch

Reopen Debugging Terminal

Open debugging window without logging in

$ rosrun rviz rviz

load file

Load navigate.rviz file on software

Calibrate Car Position

Select 2D Pose Estimate with the mouse and drag the car to coincide the red dot with the black edge

Get the robot to its target location

By selecting 2D Nav Goal with the mouse and clicking the left mouse button at the target location and dragging the mouse to provide direction, the robot will automatically reach the target location, and will automatically avoid obstacles to select the best path to reach the target location.

Multipoint navigation

Open chassis program

$ roslaunch clbrobot bringup.launch

Open multipoint navigation program

$ roslaunch clbrobot multi_goals.launch

$ roslaunch clbrobot navigate_multi.launch

Open Debugging Tool

$ rosrun rviz rviz

Load the multi_goal.rviz file on the software

Select 2D Pose Estimate with the mouse and drag the car to coincide the red dot with the black edge

Arrive at specified area

The mouse selects the Publish Point and clicks on the map to produce the first point. The same action generates the second third nth point, and the robot will reach the above area in turn

Camera Line-finding

Open chassis program

$ roslaunch clbrobot bringup.launch

Turn on the camera

$ roslaunch clbrobot camera.launch

Find Line

Turn virtual machine on

roslaunch riki_line_follower riki_line.launch

Radar Following

Open chassis program

$ roslaunch clbrobot bringup.launch

Turn on the camera

$ roslaunch clbrobot camera.launch

Open Radar Folder

$ roslaunch riki_lidar_follower laser_follower.launch

Find an object to put in front of the camera, and the robot will follow it

APP Control and Image Monitoring

Open chassis program

$ roslaunch clbrobot bringup.launch

Turn on the camera

$ roslaunch clbrobot appcamera.launch

Then configure the network to use after installing Chuanglebo APP

OpencvAPP image processing

Turn on the camera

$ roslaunch clbrobot camera.launch

Edge Extraction

$ roslaunch opencv_apps edge_detection.launch
130 original articles published. 80% praised. 70,000 visits+
Private letter follow

Tags: Python angular ssh Mobile

Posted on Sun, 12 Jan 2020 17:23:39 -0800 by samip1983