The Amiga-ROS2 bridge, currently supported for ROS2 Humble, interfaces with the Amiga gRPC services to:
- Stream data from the Amiga brain services
- Control the Amiga using the available vehicle control APIs.
Using this bridge with the amiga requires an Amiga OS v2.3.x.
Note
-
For ROS Noetic bridge on Amiga brains running Amiga OS
v2.3.x, please refer to github.com/farm-ng/amiga-ros-bridge. -
For ROS Noetic bridge on Amiga brains running Amiga OS
v1.x, please refer to github.com/farm-ng/amiga-ros-bridge-v1.
To setup the environment, you'll be working in Docker on your local machine. It will communicate to the Amiga via Tailscale using gRPC, just like any of our ADK Brain examples.
Even though this repo is a collaboration between farm-ng and Robotics@UC Merced, this is NOT an official release from farm-ng and, therefore, we can't guarantee support or long term compatibility. That said, we will do everything possible to help you use it. For suggestions, questions, or concerns, raise an issue here.
Collaboration and PRs are welcome and will be evaluated by UC Merced and Farm-ng teams on regular basis.
- Clone this repo and open the directory:
git clone https://github.com/ucmercedrobotics/amiga-ros2-bridge.git
cd amiga-ros2-bridge[Optional, but highly recommended] Create a new virtual environment
python3 -m venv venv
source venv/bin/activate
pip install --upgrade pip- Clone submodules and other repos
git submodule update
cd amiga-ros2-nav
vcs import < nav.repos
cd ..Note, this bridge works even if you're not using Nav2! We've added support for Nav2 assuming you are using a UBlox module. We use a UBlox RTK Zed-F9P module to get RTK corrections from a base station instead of using NTRIP over IP as is provided from FarmNG on the Amiga.
- After, build your ROS2 container. Note you can run either on your own machine becausce of gRPC or directly on the Amiga:
To build on your own machine,
make build-devTo build on the Amiga,
make build-prod- [Optional, for application requiring GUIs] Next, standup the noVNC container to forward X11 to your web browser.
To run the container,
make vncBe sure to run this on the same machine you're running your ROS2 bridge on.
You can view the noVNC page at http://localhost:8080/vnc.html if ran locally, or http://{IP}:8080/vnc.html if the image is remote.
- Configure and spin up your Docker container:
This step assumes you have installed Tailscale and properly configured your access to the Brain with farm-ng's support team.
Check which services/streams you want to see and/or control at amiga-ros2-bridge/include/service_config.json. Make sure you update your Brains addresses on each host:
{
"configs": [
{
"name": "canbus",
"port": 6001,
"host": "000.000.000.000"
},
...- Finally, standup the container and connect to it:
make bashYou should now be inside the container, and the terminal will show something like:
root@docker-desktop:/amiga_ros2_bridge#Once inside, build ROS2 packages,
colcon build
source install/setup.bashNote
Feel free to modify Makefile to change your container's startup command based on what you need adding port forwarding, displays, different volumes, etc.
- Expose your Amiga gRPC servers as ROS2 topics:
make amiga-streamsYou should see confirmation of the topics exposed:
...
[amiga_streams-1] [INFO] [1743180979.278455758] [amiga_streams]: Subscribing to farm-ng topic: /oak0/left and publishing on ROS topic: /oak0/left
...You should now be able to interact with the services from your ROS2 container. An example is to allow twist commands to drive the Amiga:
- Open a new terminal, connect to the container with a shell:
make shellNote, please use
make shellafter you've usedmake bashto create the container instance. This command will attach you to the current environment instead of creating a completely new one. SeeMakefilefor more details.
- Now run the twist converter:
make twistThis will listen on topic /cmd_vel from standard ROS2 velocity commands and convert them to Amiga specific CANbus velocity commands.
Prior to running anything using ROS2, make sure you activate auto control as seen in the image below.
⚠️ Make sure it is safe to move the robot without physically controlling it!⚠️
- Control remotely:
make joyThis defaults to a controller mapped to /dev/input/js0.
This default file descriptor is usually a PS4 controller.
You can connect your own contoller via bluetoothctl.
Using the onboard Oak-D cameras or your own, you can configure them to stream using ROS2 drivers. The below command will execute the DepthAI provided ROS2 drivers (including 9-axis IMU support).
make oakdTo edit the config to match your cameras, edit amiga_ros2_oakd/config/amiga_cameras.yaml prior to running the ROS2 drivers.
This repo supports mission command and control via BT.CPP XML.
We have an example behavior tree in amiga_ros2_behavior_tree, which can be adapted to fit your own robot configuration.
See amiga_ros_behavior_tree for examples.
- Inside the docker container, run the foxglove node (Farm-ng uses port
8765for their foxglove bridge, so we use8766by default),
make foxglove- Follow instructions here to open foxglove
While we use our own UBlox RTK module in order to support Nav2 related ROS2 nodes, this can be adapted to model any configuration. See our Nav2 repo for more details.
From any computer (except the Amiga since it's behind Tailscale) on the same network as the Amiga, run the proxy that will connect our webapp to the Amiga.
git clone https://github.com/vtomnet/mp-proxy, make a venv, install requirements.txt, python proxy.py --to-tcp <amiga_ip>:<bt_runner_port>.
From https://mp.vtom.net/ plan out your mission.
Note, you can configure what port the Amiga talks from through bt_runner parameter mission_port, which is defaulted to 12346.
Many services, such as the Oak-D cameras, require the exclusive use of the hardware. You may also see it fit to use this To disable default Amiga drivers, use the following command:
bash ./scripts/stop_amiga_services.shWe provide two ways of bringing up the autonomy stack:
- shell script that spawns all nodes inside tmux for debugging:
bash ./scripts/bringup_amiga_tmux.sh- Master launch file for deployment:
Start the container,
make bashOnce inside, bring up the nodes,
make bringupThis will spawn the Amiga-ROS2 bridge, Oakd cameras, URDF descriptions, localization stack, and nav2 stack.
