Giter Club home page Giter Club logo

raspimouse_ros2's Introduction

raspimouse_ros2

ROS 2 navigation pakcages for Raspberry Pi Mouse V3

OS and ROS 2 set up

First of all, you need to install Ubuntu 18.04 and ROS 2 Dashing Diademata on your Raspberry Pi 3 B and PC. Please refer the official ROS 2 installation process: https://index.ros.org/doc/ros2/Installation/Crystal/Linux-Install-Binary/

colcon and rosdep set up

sudo apt install python3-colcon-common-extensions python3-rosdep python3-argcomplete
sudo rosdep init
rosdep update

ROS_DOMAIN_ID network configuration

Set the environmental variable ROS_DOMAIN_ID to specify your network configuration. The ROS_DOMAIN_ID is a number between 0 and 255.

export ROS_DOMAIN_ID=XXX

Package build for Raspberry Pi 3 B

Raspberry Pi Mouse driver installation

git clone https://github.com/rt-net/RaspberryPiMouse.git
cd RaspberryPiMouse/src/drivers
make
sudo make install
sudo insmod rtmouse.ko
sudo usermod -aG dialout $USER

raspimouse_ros2 build

mkdir -p ~/ros/dashing/src
cd ~/ros/dashing/src
git clone https://github.com/youtalk/raspimouse_ros2.git -b ignore-cartographer-navigation2
cd raspimouse_ros2
git submodule update --init
cd ../..
rosdep install --from-paths src --ignore-src -r -y
colcon build --symlink-install
source ~/ros/dashing/install/setup.bash

Package build for PC

raspimouse_ros2 build

mkdir -p ~/ros/dashing/src
cd ~/ros/dashing/src
git clone https://github.com/youtalk/raspimouse_ros2.git
cd raspimouse_ros2
git submodule update --init
cd ../..
rosdep install --from-paths src --ignore-src -r -y
colcon build --symlink-install
source ~/ros/dashing/install/setup.bash

Keyboard teleoperation

Run Raspberry Pi Mouse and RPLiDAR A1M8 drivers.

Raspberry Pi 3 B

ros2 launch raspimouse_bringup robot.launch.py

PC

Enable Raspberry Pi Mouse.

ros2 lifecycle set raspimouse_driver configure && \
ros2 lifecycle set raspimouse_driver activate && \
ros2 service call /motor_power std_srvs/SetBool '{data: true}'

Run Rviz2.

ros2 launch raspimouse_bringup rviz2.launch.py

Run teleop_twist_keyboard.

ros2 run teleop_twist_keyboard teleop_twist_keyboard

Note that the default linear speed is too fast. Please decrease the linear speed to 0.15 [m/s] or lower by pressing x key several times.

Cartographer SLAM

Raspberry Pi 3 B

Do the same as above.

PC

First do the same as above. Then move around a floor while recording the bag file for SLAM data.

sudo apt install 'ros-dashing-ros2bag*' 'ros-dashing-rosbag2*'
ros2 bag record -a -o ./raspimouse_slam.bag

Run raspimouse_cartographer to generate 2D map.

ros2 launch raspimouse_cartographer cartographer.launch.py

Play the bag file recorded before.

ros2 bag play ~/raspimouse_slam.bag

ROS 2 Cartographer SLAM with RasPi Mouse and RPLiDAR A1M8

Save map files if the quaility of the map on RViz2 is acceptable.

ros2 run nav2_map_server map_saver -f ~/.ros/map

Note that a sample bag file and map data are stored following directories.

Navigation 2

Raspberry Pi 3 B

Do the same as above.

PC

Run raspimouse_navigation2 to launch RViz2 with the navigation configuration. Note that please wait seconds to complete launching navigation nodes.

ros2 launch raspimouse_navigation2 navigation2.launch.py map:=/home/$USER/.ros/map.yaml

Press 2D Pose Estimate button to initialize the robot pose. Then Press Navigation2 Goal to give the goal pose. The robot will start moving along the path to the goal pose.

ROS 2 Navigation with RasPi Mouse and RPLiDAR A1M8

raspimouse_ros2's People

Contributors

shotaak avatar youtalk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

raspimouse_ros2's Issues

TODO

  • colcon, rosdepインストール
  • submodulesやreadmeをgit@からhttpsに変更
  • rosdep init, updateの説明追加
  • env | grep ROSでドメインIDの確認
  • rosdepは講習会ではスキップ?
  • map.yamlのディレクトリ調整
  • ROS1 Melodicが入っていると環境変数がおかしくなる?
  • macOS, Windowsには対応しないことを明記
  • RViz2で初回scanが映らない原因究明
  • zshは非推奨(bashを使う)

COLCON build fail!

Hi,

I have cloned this repo and build it, but it gives me a fatal error?
Do you have any idea how to solve it, it will be very much appreciated?

I am using ubuntu 20.04 (foxy) and installed everything correctly like in the documentation?

image

Question related to map in raspimouse_ros2.

Nice to meet you.
I want to use ros2 + rpi lidar + cartographer.
So I am doing it by referring to your data.

S/W & H/W environment
.Ubuntu 18.04 + ros2 dashing version
.Rpi Lidar

I am trying to use slam(cartographer.) on ubuntu pc.
We proceeded in the following order.

Package build for PC

  1. raspimouse_ros2 build
    mkdir -p ~/ros/dashing/src
    cd ~/ros/dashing/src
    git clone https://github.com/youtalk/raspimouse_ros2.git
    cd raspimouse_ros2
    git submodule update --init
    cd ../..
    rosdep install --from-paths src --ignore-src -r -y
    colcon build --symlink-install
    source ~/ros/dashing/install/setup.bash

#ros2 launch raspimouse_bringup robot.launch.py

  1. Run Rviz2.
    #ros2 launch raspimouse_bringup rviz2.launch.py

The following error occurred.

Frame [odom] does not exist -> Global Status Error
[rviz2-1][ERROR][rviz2]: “odom” passed to lookupTransform argument target_grame does not exist.

Solution: Change the Fixed Frame and select base_link

  1. Run raspimouse_cartographer to generate 2D map.
    #ros2 launch raspimouse_cartographer cartographer.launch.py
    The following error occurred.

Global Status: Error
Fixed Frame: Frame[map] does not exist.

Please advise on which part to check.

Thank you.
thanks

Questions about build errors

Nice to meet you.
I am asking a question from Japan.
I cloned your github and built it. However, I get an error that the include file does not exist.

【Environment】
ubuntu20.04
ROS2 foxy

【Nonexistent file name】
rosidl_generator_cpp/message_initialization.hpp

【error description】

Starting >>> raspimouse_msgs
Starting >>> cartographer_ros_msgs
Finished <<< raspimouse_msgs [4.23s]                                 
Starting >>> raspimouse_description
Finished <<< raspimouse_description [1.27s]
Starting >>> rplidar_ros
Finished <<< cartographer_ros_msgs [6.44s]
Starting >>> raspimouse
Finished <<< rplidar_ros [2.50s]                                   
Starting >>> cartographer_ros
--- stderr: raspimouse   
/home/user/ros/foxy/src/raspimouse_ros2/raspimouse_driver/raspimouse/src/raspimouse_component.cpp:25:10: fatal error: rosidl_generator_cpp/message_initialization.hpp: There are no such files or directories.
   25 | #include <rosidl_generator_cpp/message_initialization.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/raspimouse_component.dir/build.make:63: CMakeFiles/raspimouse_component.dir/src/raspimouse_component.cpp.o] エラー 1
make[1]: *** [CMakeFiles/Makefile2:107: CMakeFiles/raspimouse_component.dir/all] エラー 2
make: *** [Makefile:141: all] エラー 2
---
Failed   <<< raspimouse [3.64s, exited with code 2]
Aborted  <<< cartographer_ros [3.87s]                             

Summary: 4 packages finished [12.2s]
  1 package failed: raspimouse
  1 package aborted: cartographer_ros
  1 package had stderr output: raspimouse
  4 packages not processed

If you have a solution, I would appreciate it if you could let me know.

submodule のraspimouse_driverがcloneできない

ラズパイ側でgit submodule update --initするとき、下記エラーが発生し、raspimouse_driverがクローンできませんでした。

エラーメッセージ

error: Server does not allow request for unadvertised object 0fe807b3bb18058a1bbab2563936b996702ee56e
Fetched in submodule path 'raspimouse_driver', but it did not contain 0fe807b3bb18058a1bbab2563936b996702ee56e. Direct fetching of that commit failed.

コミットIDをたどると、
youtalk/raspimouse2
ではなく
gbiggs/raspimouse2
をクローンしようとし、URLが一致しないためエラーが出ているようです。

修正をお願いします。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.