Skip to content

Latest commit

 

History

History
97 lines (74 loc) · 2.22 KB

README.md

File metadata and controls

97 lines (74 loc) · 2.22 KB

Rust & OSOYOO PCA9685

Building

https://osoyoo.com/2022/07/21/osoyoo-raspberry-pi-car-v2-1-lesson-1-basic-install-and-coding-gpio-pca9685-python/

Prerequisites

If needed, install vcs tool:

pip3 install vcstool

Init repo

git submodule update --init
vcs import src < src/ros2_rust/ros2_rust_humble.repos

MacOS Cross-compilation

On MacOS, we can use docker to cross-compile the code. First, we need to build the docker image:

docker build -t ros2_rust .
docker run --rm --network=host -v $PWD:$PWD -w $PWD -it ros2_rust /bin/bash

Local compilation

You need to source the ros2_rust environment every time you work on a new terminal:

source install/setup.bash

Then, we can build with colcon build:

colcon build

Xbox controller

https://index.ros.org/p/teleop_twist_joy/github-ros2-teleop_twist_joy/

Install with:

sudo apt install ros-humble-teleop-twist-joy

Run with (open new terminal):

sudo su
source /opt/ros/humble/setup.bash
ros2 launch teleop_twist_joy teleop-launch.py joy_config:='xbox'

Troubleshouting with ros2 tools

Remember that every time you need to run ros commands, you need to source the setup.bash file. You need to do that in every new terminal you open.

source /opt/ros/humble/setup.bash

If you want to see if topics are being published:

ros2 topic list

To see topic contents:

ros2 topic echo <topic-name>

Resources

Notes: