ROS-running through hawkbot robot

Preparation before operation

Ubuntu host operation

  • Connect to Raspberry Pi remotely
ssh 10.42.0.1

You can set the robot to automatically connect to WIFI after it is connected. Refer to the specific setting method: Raspberry Pi 4B-Raspbian network basic configuration: WIFI power on and direct connection, set static IP

  • If you change the Raspberry Pi WIFI connection or IP, you need to reset the ROS slave connection IP of the Ubuntu host:
    Insert picture description here

Check if the robot is working properly

  • Check whether the topic is normal
rostopic list
  • Print some data to check
              [list中的任意数据都可以打印]
rostopic echo /imu/data_raw

Run the robot!

Keyboard control

roslaunch hawkbot key_tel.py

SLAM mapping

Synchronize master and slave time

Sync the large time zone first:

sudo ntpdate -u asia.pool.ntp.org

Synchronize the time on the handset:

sudo ntpdate IP

If an error occurs, check whether the ntp service is enabled

service ntp status

Insert picture description here
If it appears failed, open the ntp service:

service ntp start

Insert picture description here
Finally, synchronize the time on the handset.

sudo ntpdate hostIP

Open slam mapping

  • Start SLAM to create a map, and you can start keyboard control, move the car to create a map.
                    [建图算法]
roslaunch hawkbot gmapping_slam.launch

Insert picture description here

  • Save map
roscd hawkbot/maps
                                [地图名称]
rosrun map_server map_saver -f my_room_map

Insert picture description here
Open the map file to view, no problem:
Insert picture description here

Navigation function

roslaunch hawkbot navigation.launch

If the calibration is abnormal, connect to the Raspberry Pi remotely and restart the sensor:

sudo hawkbot-stop

sudo hawkbot-start

Guess you like

Origin blog.csdn.net/qq_45779334/article/details/112095202