All Projects → rt-net → raspimouse_ros_examples

rt-net / raspimouse_ros_examples

Licence: Apache-2.0 license
ROS examples for Raspberry Pi Mouse

Programming Languages

python
139335 projects - #7 most used programming language
shell
77523 projects
CMake
9771 projects

Projects that are alternatives of or similar to raspimouse ros examples

raspimouse2
ROS 2 node for Raspberry Pi Mouse
Stars: ✭ 23 (+35.29%)
Mutual labels:  raspberry-pi-mouse, raspimouse
standalone-configuration-management
Basic examples of how to use each of chef, puppet, salt and ansible as standalone configuration management systems.
Stars: ✭ 14 (-17.65%)
Mutual labels:  examples
design-patterns-cookbook
Design Patterns in simple words with examples on PHP
Stars: ✭ 26 (+52.94%)
Mutual labels:  examples
k6-example-data-generation
Example repository showing how to utilise k6 and faker to load test using generated data
Stars: ✭ 32 (+88.24%)
Mutual labels:  examples
DataScience ArtificialIntelligence Utils
Examples of Data Science projects and Artificial Intelligence use cases
Stars: ✭ 302 (+1676.47%)
Mutual labels:  examples
GeoStatsTutorials
GeoStats.jl tutorials
Stars: ✭ 49 (+188.24%)
Mutual labels:  examples
polished example apps
Example Apps for Polished
Stars: ✭ 24 (+41.18%)
Mutual labels:  examples
tensorflow-example
Tensorflow-example:使用MNIST训练模型,并识别手写数字图片
Stars: ✭ 26 (+52.94%)
Mutual labels:  examples
community datasets
Example datasets and dashboards known to work well in OmniSci
Stars: ✭ 14 (-17.65%)
Mutual labels:  examples
react-samples
Multi-project repository containing examples to explain react concepts.
Stars: ✭ 25 (+47.06%)
Mutual labels:  examples
assembly-examples
assembly-examples
Stars: ✭ 23 (+35.29%)
Mutual labels:  examples
stm8-bare-min
Tiny peripheral library for STM8 microcontrolles
Stars: ✭ 103 (+505.88%)
Mutual labels:  examples
vercel-examples
📦 Example projects using Vercel platform. Using Node.js, PHP and others.
Stars: ✭ 205 (+1105.88%)
Mutual labels:  examples
tldr
Simplified and community-driven man pages (tldr-pages) in a single binary.
Stars: ✭ 33 (+94.12%)
Mutual labels:  examples
Game-Examples
Godot game examples for gotm.io - the Godot Platform!
Stars: ✭ 27 (+58.82%)
Mutual labels:  examples
understanding-gradle
The Understanding Gradle video series introduces the concepts of the Gradle Build Tool one-by-one in short videos.
Stars: ✭ 147 (+764.71%)
Mutual labels:  examples
go-interfaces
This repos has lots of Go interface usage and best practice examples
Stars: ✭ 112 (+558.82%)
Mutual labels:  examples
elm-ui-examples
Examples applications for Elm-UI
Stars: ✭ 33 (+94.12%)
Mutual labels:  examples
trillian-examples
A place to store some examples which use Trillian APIs to build things.
Stars: ✭ 116 (+582.35%)
Mutual labels:  examples
hebi-matlab-examples
Examples for the HEBI Robotics API for MATLAB
Stars: ✭ 20 (+17.65%)
Mutual labels:  examples

English | 日本語

raspimouse_ros_examples

industrial_ci

Raspberry Pi MouseのROSサンプルコード集です。

ナビゲーションのサンプルはこちら。 ROS 2のサンプルコード集はこちら

Requirements

Installation

cd ~/catkin_ws/src
# Clone ROS packages
git clone https://github.com/ryuichiueda/raspimouse_ros_2
git clone -b $ROS_DISTRO-devel https://github.com/rt-net/raspimouse_ros_examples
# For direction control example
git clone https://github.com/rt-net/rt_usb_9axisimu_driver

# Install dependencies
rosdep install -r -y --from-paths . --ignore-src      

# make & install
cd ~/catkin_ws && catkin_make
source devel/setup.bash

License

このリポジトリはApache 2.0ライセンスの元、公開されています。 ライセンスについてはLICENSEを参照ください。

How To Use Examples


keyboard_control

teleop_twist_keyboardを使ってRaspberryPiMouseを動かします。

Requirements

  • Keyboard

How to use

次のコマンドでノードを起動します。

roslaunch raspimouse_ros_examples teleop.launch key:=true

# Control from remote computer
roslaunch raspimouse_ros_examples teleop.launch key:=true mouse:=false

ノードが起動したら/motor_onサービスをコールします。

rosservice call /motor_on

back to example list


joystick_control

ジョイスティックコントローラでRaspberryPiMouseを動かすコード例です。

Requirements

How to use

次のコマンドでノードを起動します。

roslaunch raspimouse_ros_examples teleop.launch joy:=true

# Use DUALSHOCK 3
roslaunch raspimouse_ros_examples teleop.launch joy:=true joyconfig:="dualshock3" 

# Control from remote computer
roslaunch raspimouse_ros_examples teleop.launch joy:=true mouse:=false

デフォルトのキー割り当てはこちらです。

joystick_control_keyconfig

Configure

./config/joy_f710.yml./config/joy_dualshock3.yml のキー番号を編集することで、キー割り当てを変更できます。

button_shutdown_1       : 8
button_shutdown_2       : 9

button_motor_off        : 8
button_motor_on         : 9

button_cmd_enable       : 4

Videos

joystick_control

back to example list


object_tracking

色情報をもとにオレンジ色のボールの追跡を行うコード例です。 USB接続のWebカメラとOpenCVを使ってボール追跡をします。

Requirements

Installation

Raspberry Pi Mouseにカメラマウントを取り付け,WebカメラをRaspberry Piに接続します.

次のコマンドで、カメラ制御用のパッケージ(v4l-utils)をインストールします。

sudo apt install v4l-utils

How to use

次のスクリプトを実行して、カメラの自動調節機能(自動露光,オートホワイトバランス等)を切ります。

rosrun raspimouse_ros_examples camera.bash

次のコマンドでノードを起動します。

roslaunch raspimouse_ros_examples object_tracking.launch

物体検出画像はbinaryobjectというトピックとして発行されます。 これらの画像はRVizrqt_image_view で表示できます。

Configure

追跡対象の色を変更するには ./scripts/object_tracking.pyを編集します。

    def detect_ball(self):
        # ~~~ 省略 ~~~
        min_hsv, max_hsv = self.set_color_orange()
        # min_hsv, max_hsv = self.set_color_green()
        # min_hsv, max_hsv = self.set_color_blue()

反応が悪い時にはカメラの露光や関数内のパラメータを調整して下さい.

    def set_color_orange(self):
        # [H(0~180), S(0~255), V(0~255)]
        # min_hsv_orange = np.array([15, 200, 80])
        min_hsv_orange = np.array([15, 150, 40])
        max_hsv_orange = np.array([20, 255, 255])
        return min_hsv_orange, max_hsv_orange

Videos

object_tracking

back to example list


line_follower

ライントレースのコード例です。

Requirements

Installation

Raspberry Pi Mouseにライントレースセンサを取り付けます。

How to use

次のコマンドでノードを起動します。

roslaunch raspimouse_ros_examples line_follower.launch

# Control from remote computer
roslaunch raspimouse_ros_examples line_follower.launch mouse:=false

Raspberry Pi Mouseをフィールドに置き、SW2を押してフィールド上のセンサ値をサンプリングします。

次に、センサとラインが重なるようにRaspberry Pi Mouseを置き、SW1を押してライン上のセンサ値をサンプリングします。

最後に、ライン上にRaspberry Pi Mouseを置き、SW0を押してライントレースを開始します。

もう一度SW0を押すとライントレースを停止します。

Configure

走行速度を変更するには./scripts/line_follower.pyを編集します。

    def _publish_cmdvel_for_line_following(self):
        VEL_LINER_X = 0.08 # m/s
        VEL_ANGULAR_Z = 0.8 # rad/s
        LOW_VEL_ANGULAR_Z = 0.5 # rad/s

        cmd_vel = Twist()

Videos

line_follower

back to example list


SLAM

LiDARを使ってSLAM(自己位置推定と地図作成)を行うサンプルです。

Requirements

RPLIDARについては、パッケージrplidar_ros がROS Noetic向けにリリースされていないため動作確認していません。

Installation

Raspberry Pi MouseにLiDARを取り付けます。

  • URG-04LX-UG01
  • LDS-01

How to use

Raspberry Pi Mouse上で次のコマンドでノードを起動します。

# URG
roslaunch raspimouse_ros_examples mouse_with_lidar.launch urg:=true port:=/dev/ttyACM0

# LDS
roslaunch raspimouse_ros_examples mouse_with_lidar.launch lds:=true port:=/dev/ttyUSB0

Raspberry Pi Mouseを動かすためteleop.launchを起動します

# joystick control
roslaunch raspimouse_ros_examples teleop.launch mouse:=false joy:=true joyconfig:=dualshock3

次のコマンドでSLAMパッケージを起動します。(Remote computerでの実行推奨)

# URG
roslaunch raspimouse_ros_examples slam_gmapping.launch urg:=true

# LDS
roslaunch raspimouse_ros_examples slam_gmapping.launch lds:=true

Raspberry Pi Mouseを動かして地図を作成します。

次のコマンドで作成した地図を保存します。

mkdir ~/maps
rosrun map_server map_saver -f ~/maps/mymap

Configure

./launch/slam_gmapping.launchgmappingパッケージのパラメータを調整します。

  <node pkg="gmapping" type="slam_gmapping" name="raspimouse_slam_gmapping" output="screen">
    <!-- <remap from="scan" to="base_scan"/> -->
    <param name="base_frame" value="base_link" />
    <param name="odom_frame" value="odom" />
    <param name="map_frame"  value="map" />
    <param name="map_update_interval" value="1.0"/>
    <param name="maxUrange" value="5.6" if="$(arg urg)"/>
    <param name="maxUrange" value="12" if="$(arg rplidar)"/>
    <param name="maxUrange" value="3.5" if="$(arg lds)"/>
    <!-- <param name="sigma" value="0.05"/> -->
    <!-- <param name="kernelSize" value="1"/> -->
    <!-- <param name="lstep" value="0.05"/> -->

Videos

slam_urg

back to example list


direction_control

IMUセンサを使用した角度制御のコード例です。

Requirements

Installation

LiDAR MountにIMUセンサモジュールを取り付けます。

Raspberry Pi Mouse にLiDAR Mountを取り付けます。

How to use

次のコマンドでノードを起動します。

roslaunch raspimouse_ros_examples direction_control.launch

SW0 ~ SW2を押して動作モードを切り替えます。

  • SW0: ジャイロセンサのバイアスをキャリブレーションし、ラズパイマウスの方位角を0 radにリセットします
  • SW1: 方位角を0 radに維持する角度制御を開始します
    • SW0 ~ SW2を押すか、ラズパイマウス本体を横に傾けると終了します
  • SW2: 方位角を-π ~ π radに変化させる角度制御を開始します
    • SW0 ~ SW2を押すか、ラズパイマウス本体を横に傾けると終了します

Configure

角度制御に使うPID制御器のゲインを変更するには./scripts/direction_control.pyを編集します。

class DirectionController(object):
    # ---
    def __init__(self):
        # ---
        # for angle control
        self._omega_pid_controller = PIDController(10, 0, 20)

Videos

slam_urg

back to example list

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].