Skip to content
/ rosbot Public

My robot for my YouTube channel 'Markus Knapp - Einfach machen'

Notifications You must be signed in to change notification settings

markusk/rosbot

Repository files navigation

rvr

A ROS Python package for my rosbot - running on a Raspberry Pi.

Please note: this code is still in the middle of the development process!

GitHub issues GitHub stars GitHub license


Step 1: Setup Raspberry with Ubuntu

Download and install pigpio

https://abyz.me.uk/rpi/pigpio/download.html (See detailed instructions there - will be installed to /usr/local/lib and /usr/local/bin)

clone this repository

https://github.com/markusk/rosbot

git clone https://github.com/markusk/rosbot.git
cd rosbot

Step 2: Setting up pigpiod for autostart with systemd

sudo cp raspi/etc__systemd__system__rosbot-boot.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable rosbot-boot.service
sudo systemctl start rosbot-boot.service

Step 3: Joystick/Gamepad OS support

sudo apt-get install joystick

Microsoft XBOX Wireless Controller

  • Supported by the Kernel - if used with the USB connector.

Gamepad/Joystick test

  • Connect a Gamepad to the Pi, start the following command and press any buttons or move some axes:
jstest --normal /dev/input/js0

Step 3: ROS 2

  • Install ROS on your Raspberry Pi (Instruction):

  • Install ROS packages (+++ TO BE DEFINED !!! +++):

  • Do not forget to "autostart" ros; i.e. in your terminal, when logging in:

echo 'source /opt/ros/jazzy/setup.bash' >> ~/.bashrc

Step 5: Create a central place for this repository

  • Create your own development directory "develop"
mkdir ~/develop
cd ~/develop
  • Clone this repository
git clone https://github.com/markusk/rvr.git
  • Create a colcon workspace (ROS 2) with 'src' subfolder:
mkdir -p ~/ros2_ws/src
  • Create symbolic link with the name of each ros package from this repository, pointing into the 'src' folder from your ROS/colcon workspace (ros_ws):
cd ~/ros2_ws/src
ln -s ~/develop/rosbot/ROS/colcon_workspace/src/rosbot rosbot
ln -s ~/develop/rosbot/ROS/colcon_workspace/src/testbot testbot
  • Now also source your ROS workspace you created:
echo 'source ~/ros2_ws/install/setup.bash' >> ~/.bashrc
  • Build the ROS rosbot package
cd ~/ros2_ws
colcon build --symlink-install
source install/setup.bash

Step 7: Run ROS 2

Test the rosbot ROS package

  • Start the ROS launch file:
cd ~/ros2_ws
ros2 launch rosbot test.launch
  • The output should look like above.
  • Exit the program with CTRL-C.

The main launch file

  • Run the main launch file on the robot (Raspberry Pi):
cd ~/catkin_ws
roslaunch rvr rvr.launch

to do: On another computer (the ground control center):

export ROS_MASTER_URI=http://<hostname>:11311
rosparam set joy_node/dev "/dev/input/js1"
roslaunch rvr ground_control_center.launch

to do: Step 8: Setting up ROS for autostart

systemd under Ubuntu

sudo cp raspi/etc__systemd__system__rvr-ros-start.service /etc/systemd/system/rvr-ros-start.service
sudo systemctl daemon-reload
sudo systemctl start rvr-ros-start.service
sudo systemctl enable rvr-ros-start.service

The ROS launch files

K

keyboard_control_test

Listens to a teleop_twist_keyboard node and prints out the data/messages. Uses:

  • teleop_twist_keyboard
  • nodes/keyboard_listener.py

M

motor_server

Controls the motors on the robot. Uses:

  • motor_server.py

R

rvr

Controls the whole robot. To be started on the robot. Uses:

  • motor_server.py

to do:

  • tf_broadcaster.py
  • battery_publisher.py
  • imu_bno055.py
  • base_controller.py
  • minibot_camera
  • urg_node

About

My robot for my YouTube channel 'Markus Knapp - Einfach machen'

Resources

Stars

Watchers

Forks

Packages

No packages published