eduroam first
After a cold-boot, the car might fail to connect to eduroam, possibly due to a time-sync issue. Either connect it to a phone hotspot and allow the time to synchronize, or connect a keyboard & monitor, and fix the time manually. Once that’s handled, use
nmtuito re-connect it toeduroam
sudo bluetoothctl
sudo systemctl restart bluetooth.servicescan onController 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.If running the current docker setup, the permissions will be handled by the docker-compose file. If not, then you may need to change the permissions of /dev/input/.
https://github.com/RTIS-Lab/f1tenth_car_docker
Everything runs in docker containers. All containers are derived from a base.Dockerfile file. The base container installs ROS2 Humble and uv, and installs other common dependencies.
There are three major containers:
The system container, defined in f1tenth_system, runs the sensor, joystick, and motor drivers, and some utility publishers.
The drive container, defined in f1tenth_drive, handles all the driving algorithms.
The discovery container runs a ROS2 discovery server.
/teleop/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_drivepackage
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
/maptopic
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_spacewith the name of the map to save to.
you can stop theoccupancy_grid_nodeand 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=1is necessary to fix a numpy bug - otherwise the localization will take up 100% of all CPU cores!
wall-e uses ROS_DOMAIN_ID=2
The following link contains a Dockerfile and assets that starts a virtual desktop with Ros 2 Foxy installed. Built it with docker build -t kw/ros2-desktop-vnc:foxy . and run it with sudo docker run --group-add video --group-add render --network host --security-opt seccomp=unconfined --shm-size=512m kw/ros2-desktop-vnc:foxy
Connect to the VNC session at localhost:5902. When you create a terminal in the session, ROS2 will already be sourced and ready, just make sure to run export ROS_DOMAIN_ID=2 (depending on the system or car you’re monitoring). Then, run rviz2
Adapted from https://github.com/husarion/ros2-desktop-vnc
Connect the car to a display, keyboard, and mouse to change WiFi settings, OR use the micro-usb port and minicom.