Skip to content

Warthog Teach and Repeat (ROS1)

Effie Daum edited this page Feb 4, 2024 · 1 revision

Here is a small tutorial on how to perform the basic teach-and-repeat functions on the Warthog. This tutorial was written by Clément Courcelle.

Preparation

First, you need to power up the robot with the main switch, located in its back. Then you can turn on the four switches on the front and those for the LIDAR sensors you want to use for your experiment.

Before using the robot, check if the battery is charged enough by looking at the voltage measure. The nominal tension of the Warthog is 52V, so if the value indicated is below 50V, it is recommended to fully charge the battery before using the robot.

You also have to call the security (418 656-2131,408500) to ask them to remove the post at gate 2 of the building, so that there is enough room for the robot to pass the door.

Then, check that the PC is connected to the robot's Wifi network called warthog_2GHz. You can connect your PC to the Warthog via SSH.

ssh robot@robot-snow

Teach Phase

During the teach the phase, the robot is driven manually to record a trajectory. The robot will localize and build a map of the environment.

Drive the robot manually to the starting point of your experiment. We use screen to make sure the nodes we launch are still active even if the SSH connection is temporarily lost. The most basic commands to use screen are:

screen -S <session-name>    // to start a named session
Ctrl + a - d 		    // to detach from the current screen session
screen -r <session-name>    // to reattach a screen session

On three different screen sessions, launch the following nodes.

roslaunch warthog_mapping realtime_experiment.launch
roslaunch wiln warthog.launch
rosbag record -a

Call the service to start the recording of the trajectory.

rosservice call /start_recording

Then, you can drive the robot to create the trajectory you want.

Once done, you can stop the recording. Reattach the screen where you launched the rosbag record and kill the process. Also call:

rosservice call /stop_recording

It is recommended to smooth the trajectory at the end of the teach to make it easier for the controller to follow the path. This is done by calling:

rosservice call /smooth_trajectory

Repeat Phase

The repeat phase consists in following a given route in an autonomous way.

If the following nodes are not launched already, launch them in two screen sessions.

roslaunch warthog_mapping realtime_experiment.launch
roslaunch wiln warthog.launch

If you just recorded the trajectory, it should still be in the active memory of the robot. If it is not, load the ltr file of your trajectory.

rosservice call /load_ltr <file_name>

You can then start the repeat phase.

rosservice call /play_loop_trajectory <nb_loops>

If you are satisfied with the trajectory, you can save it in a .ltr file.

rosservice call /save_ltr <file_name>

You can them stop all the launch nodes and close the screen sessions.

Retrieve the data

Plug a hard drive on the front of the robot. Find the path of the disk with fdisk -l or df -h.

Then, mount the disk and copy the data.

sudo mount <disk_path> SSD_mountpoint
cp <bag_file> SSD_mountpoint/rosbags/

Verify the data was copied correctly by checking the files size. If it is correct, delete the data on the warthog and unmount the disk.

sudo umount SSD_mountPoint

Turning off

If the SSH connection was not active anymore, start it again with ssh robot@robot-snow and:

sudo poweroff
exit
ssh administrator@cpr-lav07
sudo poweroff
exit

You can the turn off the 3 LIDAR switches, the 4 switches in the front, and the main switch in the back.

Don't forget to charge the battery with the plug under the left rear door for the next user.

Good practices

  • If needed, clean water in the workshop.

Further information

A list of the services useful for teach and repeat can be found here.

Norlab's Robots

Protocols

Templates

Resources

Grants

Datasets

Mapping

Deep Learning

ROS

Ubuntu

Docker (work in progress)

Tips & tricks

Clone this wiki locally