All pages
Powered by GitBook
1 of 1

Loading...

ROS

ROS Interface

มี ROS wrapper ให้นักพัฒนาเชื่อมต่อกับ ROS environment.ได้อย่างสะดวกสบาย แนะนำให้ใช้ ROS ร่วมกับ Raspberry Pi.

Using ROS on Raspberry Pi

ในปัจจุบัน แนะนำให้ติดตั้ง ROS โดยใช้ Docker

  • install docker on Raspberry Pi ()

  • prepare workspace

  • run the container

  • source files and build inside the container

  • run examples (see for more)

Using ROS for remote control

ROS ถูกออกแบบมาเพื่อให้เหมาะสมกับการคำนวณแบบกระจาย ต่อไปนี้เป็นตัวอย่างง่ายๆ เกี่ยวกับวิธีการเรียกใช้โหนดบนเครื่องคอมพิวเตอร์ต่างกัน

  • on host machine (usually more powerful than Raspberry Pi)

  • run service node on Raspberry Pi

  • send command from host

Examples

  • using serial library

  • using ROS service

ref
Examples
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
mkdir -p workspace/src
cd workspace/src
git clone https://github.com/PetoiCamp/ros_opencat
cd ros_opencat
git submodule init && git submodule update
cd ../../..
docker run -v path/to/workspace:/workspace \
-it --rm --privileged --network host --name ros ros:noetic-robot
cd /workspace
source /opt/ros/noetic/setup.bash
catkin_makbase
source devel/setup.bash
rosrun opencat_examples opencat_examples_serial
# launch server
roscore
export ROS_MASTER_URI=http://<Host_IP>:11311/
rosrun opencat_server opencat_service_node
rosrun opencat_examples opencat_examples_client_cpp
rosrun opencat_examples opencat_examples_serial
# 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