This repository was tested using ROS 2 Eloquent Elusor (follow official documentation for installation)
Currently using a forked version.
For installing it follow the steps from Clone and build
python3 -m pip install opencv-python
-
Create a new ROS2 workspace or use an existing one
mkdir -p ~/cozmo_ros2_ws/src
-
Clone this repo
git clone --recursive https://github.com/solosito/cozmo_ros2_ws.git ~/cozmo_ros2_ws/src/.
-
Install PyCozmo local version
cd ~/cozmo_ros2_ws/src/pycozmo
python3 -m pip install -e .
-
Build the code
Go to the workspace folder
cd ~/cozmo_ros2_ws
then
colcon build
-
Source the workspace
. ~/cozmo_ros2_ws/install/setup.bash
-
Connect to the Cozmo Wi-Fi network
-
Run the cozmo bringup node
ros2 run cozmo_ros2_nosdk bringup
-
Run the cozmo keyboard teleop controller node in a new terminal (need to source workspace)
ros2 run cozmo_ros2_nosdk teleop_twist_keyboard
-
Run the image viewer
ros2 run image_tools showimage --ros-args --remap image:=/cozmo/camera
Error:
Cannot connect to cozmo:
pycozmo.exception.ConnectionTimeout: Failed to connect to Cozmo.
Solution:
Stop the rest of the nodes before starting the cozmo bringup node.