Aardvark
(get the password from kurt, or someone who knows it) when it bootsprecious
and wall-e
, and the password for both is 2244
After booting, run the
config_headless.sh
script in the home folder withsudo sh config_headless.sh
. This disables the display server, turns off powersaving, and deletes some temporary files
Connect over ssh: ssh precious@192.168.73.242
(Substitute the correct address from your router/hotspot)
Run sudo bluetoothctl
, and turn on your controller. You should see connected appear somewhere in the logs. Run sudo chown precious /dev/input/event*
to make sure ROS2 has the ability to read the controller
Make sure ROS has permissions for the controller: sudo chown wall-e /dev/input/event*
sudo bluetoothctl
sudo systemctl restart bluetooth.service
scan on
Controller
line should appear in the scan results. Note the address (in the form of 00:00:00:00 etc) in that linepair 00:00:00...
, using the address found in the previous step. Tab completion works here - type the first few digits and press tabtrust 00:00:00...
and connect 00:00:00...
bluetoothctl
console with exit
/dev/input
using ls /dev/input/
- there should be a js0
in the list.Explore the ros2_ws
workspace. There is an f1tenth_stack
folder with some launch scripts that handles sensor+motor nodes.
Start the websocket forwarder: ros2 launch rosbridge_server rosbridge_websocket_launch.xml
Connect a controller, and make sure permissions are set properly. cd
into your workspace. Each terminal needs to have it’s ROS configuration variables set - do source /opt/ros/foxy/setup.bash
(sets up the system’s ROS commands) and source install/setup.bash
(sets up the workspace ROS commands). If you get many ‘no such package/node’ results when running ros2
commands, make sure you ran the source
commands in the terminal.
Run ros2 launch f1tenth_stack bringup_launch.py
This is if the car is using the standard
f1tenth_stack
setup. Some cars have car-specific changes inf1tenth_stack
, but the command should be the same. We substitute the teleop node inf1tenth_stack
with our own inkw_f110_drive
, which adds extra features like virtual gear shifting and autonomous safety buttons.
Keep this terminal running!
Our modified teleop script publishes a bool
over /run_auto
. Your own autonomous code should listen to this, and only publish to /drive
when /run_auto
is true.
Important: when
/run_auto
changes from true to false, send one/drive
message with speed set to 0 to ensure that the car comes to a stop!
The rl_driver
node has some parameters that can be passed over the command line, through a config file, or left as default. The rl_driver
node is best run using a launch file: ros2 launch rtis_f110_rl rl_driver.launch.xml
. The config parameters are loaded from config/rl_driver.yaml
.
Place models in the models
folder, and set the model appropriately in the config file.
Make sure
bringup_launch.py
is running in a different terminal, otherwise, therl_driver
will do nothing
/drive
: an AckermannDriveStamped
message, that contains a target speed value and steering angle. Publish to this to control the vehicle.
/scan
: a LaserScan
message, that contains the lidar scan data. Subscribe to this to get the lidar data. This publishes 1080 points, with a 270 degree field of view at 40Hz.
/odom
: a Odometry
message, that contains the vehicle’s position and velocity. Subscribe to this to get the vehicle’s position.
/run_auto
: A Bool
message, that contains a boolean value. Publish a true value to this topic to start the vehicle’s automatic control package. Your driving code should listen to this topic, and only publish to /drive
when /run_auto
is true. This topic is published by the teleop node whenever the correct button is pressed on a gamepad.
For all terminals, cd into ros2_ws
(or your own workspace) and soucre the workspace with source install/setup.zsh
Then, in one terminal, start the driving stack: ros2 launch f1tenth_stack bringup_launch.py
in another terminal, start Cartographer (the mapping tool): ros2 run cartographer_ros cartographer_node -configuration_directory src/kw_f110_drive/config -configuration_basename cartographer.lua
this uses the cartographer.lua config in the
kw_f110_drive
package
In a third terminal, start the occupancy grid publisher: ros2 run cartographer_ros occupancy_grid_node -resolution 0.05 -publish_period_sec 1.0
This is necessary to visualize the generated map before saving it. The map will appear on the
/map
topic
Drive around for a while, and watch the map build up
To save it, run ros2 run nav2_map_server map_saver_cli -f lab_space
replace
lab_space
with the name of the map to save to.
you can stop theoccupancy_grid_node
and re-use that terminal, or create a new terminal tab
Copy the generated lab_space.pgm
and lab_space.yaml
to src/particle_filter/maps
and rebuild. Edit src/particle_filter/config/localize.yaml
and fill in the map name.
Run OMP_NUM_THREADS=1 ros2 launch particle_filter localize_launch.py
OMP_NUM_THREADS=1
is necessary to fix a numpy bug - otherwise the localization will take up 100% of all CPU cores!
Connect the car to a display, keyboard, and mouse to change WiFi settings, OR use the micro-usb port and minicom.
To build only one package (which speeds up compile times if you only changed a subset of packages), we have a macro called rosbuild_only
. Just list any packages that need rebuilding rosbuild_only simple_driver
.