-
Notifications
You must be signed in to change notification settings - Fork 1
Running rosserial Devices on WSL with Ubuntu
Before proceeding, ensure you have completed Step 8 of the "Installing ROS Noetic on WSL with Ubuntu 20.04" tutorial. You must have all the required packages installed and ROS properly configured.
Your MCU should be running rosserial code, and this tutorial will teach you how to test it. Think of your WSL setup as a simulation of the Jetson running ROS 1.
This section explains how to bind the power board Teensy to WSL and run a dry test for the thrusters.
- Open an elevated Command Prompt (
cmd
as administrator) and type:usbipd list
Identify the device (in this case, the power board Teensy).
-
Bind the device using its busid:
usbipd bind --busid <busid>
Then attach your device:
usbipd attach --wsl --busid <busid>
-
Open WSL and check if the Teensy is recognized:
ls /dev/tty*
Let us assume it is connected to
/dev/ttyACM0
. -
Clone the software repository:
git clone https://github.com/mcgill-robotics/auv-2025
-
Modify the propulsion launch file:
vim auv-2025/catkin_ws/src/propulsion/launch/propulsion.launch
- Press
i
to edit. - Locate the line
<param name="port" value="/dev/power"/>
- Change
/dev/power/
to the correct port, e.g.:<param name="port" value="/dev/ttyACM0"/>
- Press
Escape
and type:wq
and click onEnter
to save and exit. - If you have issues exiting Vim, you're not alone, google it.
- Press
-
Build the workspace:
cd auv-2025/catkin_ws catkin build
Ensure that propulsion and auv_msgs packages build successfully.
-
Source the worksapce:
source devel/setup.bash
-
Launch the dry test:
roslaunch propulsion drytest.launch
If connected to the power board Teensy, follow the menu instructions to test each thruster one by one.
⚠ Avoid running all thrusters simultaneously due to capacitance limitations that need to be resolved.
If the MCU you want to test includes any custom messages, you will have to proceed by building and sourcing just like in the propulsion example instead of simply running roscore
. The process is much more complicated, and I recommend to avoid custom messages where possible.
To test an MCU running rosserial, follow these steps:
-
Start a
tmux
session:tmux
This allows you to split the terminal. You could use multiple terminals instead, but
tmux
makes navigation easier. -
Start
roscore
:roscore
-
Split the terminal:
- Press
Ctrl + b
, then"
to split horizontally. - Press
Ctrl + b
, then%
to split vertically. - Navigate between panes using
Ctrl + b
and the arrow keys.
- Press
-
Run the rosserial node: Assuming the device is already bound to WSL and is on /dev/ttyUSB0, start the serial node:
rosrun rosserial_python serial_node.py _port:=/dev/ttyUSB0 _baud:=115200
-
Check available topics: In another
tmux
pane, run:rostopic list
-
Listen to a topic: Chose a topic and echo its message:
rostopic echo /topic_name
-
Publishing to a topic:
- Example: Publishing thruster PWM signals:
rostopic pub /propulsion/microseconds auv_msgs/ThrusterMicroseconds "{microseconds: [1500, 1500, 1500, 1500, 1500, 1500, 1500, 1500]}"
- Simpler example: Publishing an integer value of 1 at 10 Hz:
rostopic pub /example_topic std_msgs/Int32 1 -r 10
- Example: Publishing thruster PWM signals:
Now your MCU is communicating with ROS!