Skip to content

PetoiCamp/ros_opencat

Repository files navigation

ros_opencat

Control robots powered by OpenCat using ROS.

Description

  • opencat_serial - serial library for OpenCat implemented in C++
  • opencat_server - ROS interface for controlling OpenCat
  • opencat_examples - demo programs on how to use the project
  • opencat_description - mesh and model files

Usage

Install

NOTE: due to multi-threading in make process, catkin build may fail, in that case just rerun the command multiple times.

Make sure you have installed ROS and can run catkin build. In src directory, run

git clone https://github.com/TomCC7/ros_opencat
cd ros_opencat
# clone serial lib
git submodule init
git submodule update
cd ../..
catkin build
source ./devel/setup.sh

Using ROS on Raspberry Pi

Currently, it's recommended to install ROS using docker.

  • install docker on Raspberry Pi (ref)
sudo apt-get update && sudo apt-get upgrade
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
sudo usermod -aG docker pi
# test installation
docker run hello-world
  • prepare workspace
mkdir -p workspace/src
cd workspace/src
git clone https://github.com/TomCC7/ros_opencat
cd ros_opencat
git submodule init && git submodule update
cd ../../..
  • run the container
docker run -v path/to/workspace:/workspace \
-it --rm --privileged --network host --name ros ros:noetic-robot
  • source files and build inside the container
cd /workspace
source /opt/ros/noetic/setup.bash
catkin build
source devel/setup.bash
rosrun opencat_examples opencat_examples_serial

Multiple Machines (ref)

Ros is designed with distributed computing in mind. Here's a simple example on how to run nodes on different machines.

  • on host machine (usually more powerful than Raspberry Pi)
# launch server
roscore
  • run service node on Raspberry Pi
export ROS_MASTER_URI=http://<Host_IP>:11311/
rosrun opencat_server opencat_service_node
  • send command from host
rosrun opencat_examples opencat_examples_client_cpp

Examples

  • using serial library
rosrun opencat_examples opencat_examples_serial
  • using ROS service
# start core
roscore
# start service server
rosrun opencat_server opencat_service_node
# examples using oppencat ros service in C++
rosrun opencat_examples opencat_examples_client_cpp
# examples using opencat ros service in python
rosrun opencat_examples opencat_examples_client_py

Dependency

  • serial - a C++ serial library compatible with ROS

About

control opencat robots using ROS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •