Skip to content

KazumichiShirai/ros2_pibot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ROS2_PiBOT

Hardware

動作環境

Ubuntu-18.04.3 64bit (Rapsberry Pi 3 B+にインストールする)

Raspbianではないので、注意

Requirements

ROS2 (Dashing Diademata)

https://index.ros.org/doc/ros2/Installation/Dashing/Linux-Install-Debians/

pigpio

http://abyz.me.uk/rpi/pigpio/download.html 通りにインストール

wget https://github.com/joan2937/pigpio/archive/v74.zip
unzip v74.zip
cd pigpio-74
make
sudo make install

Clone and Build

$ mkdir ros2_test_ws
$ cd ./ros2_test_ws
$ git clone https://github.com/KazumichiShirai/ros2_pibot.git
$ colcon build --symlink-install

Usage

$ sudo su
# . install/setup.bash
# ros2 run ros2_pibot pibot_controller

gamepadで操作したい場合

Raspbeey Piでは次のコマンドを実行して、pibot_controllerを実行

$ sudo su
# . install/setup.bash
# ros2 run ros2_pibot pibot_controller

gamepadを接続したPCがRaspberry piと同じネットワーク上にある状態で、そのPC上で次のコマンドを実行

$ ros2 run joy joy_node joy:=/controller/joy

ROS API

~controller/joy (sensor_msgs/Joy)

Memo

motor_control.cpp

概要

  • joy[X]とjoy[Y]をもらい、その値に応じて2つのモーターを制御する

関数

pigpio

$ sudo su
# . install/setup.bash

上記のコマンドをしてから実行

gamepad

  • logicool gamepad f310
  • sudo apt install ros2-dashing-joy
  • sudo apt install ros-dashing-joy-teleop
export ROS_DOMAIN_ID=27
ros2 run joy joy_node joy:=/controller/joy

同じネットワークでROS2

  • ROS_DOMAIN_IDで接続
  • VMWareを使っている場合は、ブリッジ接続にする

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published