Warthog Teach and Repeat (ROS2) - norlab-ulaval/Norlab_wiki GitHub Wiki
connect to the robot wifi : Warthog_2GHz
wifi settings : http://192.168.0.1
Start the full Teach and Repeat stack with this script:
./wiln.sh
Note : This launches 4 screens (sensors, mapping, controller and wiln), make sure they are all running.
- Create 3 screens using the command
screen -S <name>
of in 3 different terminals:
- mapping
- controller
- wiln
- Join each screen using
screen -r <name>
- Detach each screen : Ctrl+A D
- In mapping launch the node :
ros2 launch husky_mapping realtime_experiment_launch.xml
- In controller launch the node :
ros2 launch norlab_controllers_ros husky_mpc_launch.xml
- In wiln launch the node :
ros2 launch wiln husky_launch.xml
ws://warthog-high-level:8765
scp warthog-high-level:/home/robot/Warthog_TnR_Foxglove.json <your_local_path>
You can also download the new layout that adds button for the different actions inside the T&R.
Run the topic list for auto-complete :
ros2 topic list
- Start recording the trajectory :
ros2 service call /start_recording std_srvs/srv/Empty
- Stop recording the trajectory :
ros2 service call /stop_recording std_srvs/srv/Empty
- Start playing the trajectory :
ros2 service call /play_line std_srvs/srv/Empty
- To clear the trajectory to repeat :
ros2 service call /clear_trajectory std_srvs/srv/Empty
ros2 service call /save_map_traj wiln/srv/LoadMapTraj "file_name:
data: '<name>.ltr'"
ros2 service call /load_map_traj wiln/srv/LoadMapTraj "file_name:
data: '<name>.ltr'"
For convenience, aliases were created on the warthog in the .bashrc. Here are the definitions:
# WILN aliases
alias wiln_start_recording="ros2 service call /start_recording std_srvs/srv/Empty"
alias wiln_stop_recording="ros2 service call /stop_recording std_srvs/srv/Empty"
alias wiln_play_line="ros2 service call /play_line std_srvs/srv/Empty"
alias wiln_clear_trajectory="ros2 service call /clear_trajectory std_srvs/srv/Empty"
alias wiln_cancel_trajectory="ros2 service call /cancel_trajectory std_srvs/srv/Empty"
wiln_play_loop() {
if [ -z "$1" ]; then
echo "You need to pass provide the nummber of loop you wish to do"
else
ros2 service call /play_loop wiln/srv/PlayLoop "nb_loops:
data: $1"
echo "Repeat started for $1 loops."
fi
}
wiln_load_map_traj() {
if [ -z "$1" ]; then
echo "You need to pass a file name to save the map and trajectory."
else
ros2 service call /load_map_traj wiln/srv/LoadMapTraj "file_name:
data: '$1.ltr'"
echo "Map and trajectory loaded from $1.ltr"
fi
}
wiln_save_map_traj() {
if [ -z "$1" ]; then
echo "You need to pass a file name to save the map and trajectory."
else
ros2 service call /save_map_traj wiln/srv/LoadMapTraj "file_name:
data: '$1.ltr'"
echo "Map and trajectory saved to $1.ltr"
fi
}