← Back to Modules

Start the micro‑ROS agent

Run the micro‑ROS serial agent in a Docker container to bridge the Teensy with ROS 2.

The Teensy communicates with ROS 2 via a micro‑ROS agent, which runs in a Docker container. Launch the agent on your development computer, mounting /dev for serial access, loading environment variables (including ROS_NAMESPACE), using the data channel interface (if00), and enabling verbose logging.

bash
SERIAL_NUM=$(find /dev/serial/by-id/ -name "usb-Teensyduino*if00" | head -1 | sed 's/.*_Dual_Serial_\(.*\)-if00/\1/')
SERIAL_DEV="/dev/serial/by-id/usb-Teensyduino_Dual_Serial_${SERIAL_NUM}-if00"
echo "Using device: $SERIAL_DEV"
bash
sudo docker run -it --rm \
  -v /dev:/dev --privileged --net=host \
  --env-file ~/env.list \
  --name agent microros/micro-ros-agent:kilted \
  serial --dev $SERIAL_DEV -v4

Subscribe to our newsletter

The latest educational robotics news and articles, sent to your inbox weekly.