F.A.Q

Multi-computer configuration

Configure a ROS_DOMAIN_ID betwwen 1 and 100 in your bashrc file to limit the topics area, and set ROS_LOCALHOST_ONLY to zero to permits several computer to share ROS ressources.

gedit ~/.bashrc

add at the end of the file (with 42 for instance):

export ROS_LOCALHOST_ONLY= 0
export ROS_DOMAIN_ID= 42

ROS2 tbot driver

How to get rid of ROS1 ;-)

Install ROS2 tbot driver:

cd ~/ros2_ws/pkg-tbot
git pull
./script/install-kobuki_ros.sh

cd ~/ros2_ws
colcon build

Launch ROS2 tbot driver:

# base only
ros2 launch tbot_start base.launch.py

# base + laser
ros2 launch tbot_start minimal.launch.py

# base + with laser + camera
ros2 launch tbot_start full.launch.py

ros2 topic list

Fix malformed packets

Info there: https://github.com/kobuki-base/kobuki_core/commit/2bc11a1bf0ff364b37eb812a404f124dae9c0699

sudo cp /home/bot/ros2_ws/pkg-kobuki/kobuki_core/60-kobuki.rules /lib/udev/rules.d/

Then unplug / replug the robot. To ensure it worked, the followwing command should display 1:

cat /sys/bus/usb-serial/devices/ttyUSB0/tty/ttyUSB0/device/latency_timer

How to install Ubuntu ?

Ubuntu is a fork of the Debian project, a Linux-based desktop operating system.

Notice that, ubuntu can be installed in double boot mode in parallel to a Microsoft OS on your personal computer. It is not recommended to use Ubuntu+ROS in a virtual machine (the performances would be poor).

To-do:

  • Install Ubuntu 20.04 LTS (Long Term Supported version) from live USB-Key

  • Ideally, use all the hard disk (you can split the disk in advance for double-boot install)

  • Configure "bot" username and "bot" password.

  • Configure network

  • Login and upgrade your installation

sudo apt update
sudo apt upgrade

There is no Wifi on my dell-xps13 ?

  1. Connect with cable

  2. Get the appropriate drivers: killer driver

sudo add-apt-repository ppa:canonical-hwe-team/ backport-iwlwifi
sudo apt-get update
sudo apt-get install backport-iwlwifi-dkms
  1. reboot

Remove password asking for docker commands

sudo echo "\n%sudo   ALL=(ALL) NOPASSWD: /usr/bin/docker\n" >> /etc/sudoers

Catkin_create_pkg - invalid email ?

you can use the -m option to force an author name.

catin_create_pkg -m AuthorName package_name [dependencies...]

opencv_createsamples

The latest OpenCV does not include opencv_createsamples. Let's compile an older version (~5 min on labs PC).

git clone https://github.com/opencv/opencv.git
cd opencv
git checkout 3.4.17
mkdir build
cd build
cmake -D'CMAKE_BUILD_TYPE=RELEASE' ..
make -j8

ls -l bin/opencv_createsamples

How to get an aligned depth image to the color image ?

you can use the align_depth:=true ROS parameter. The aligned image is streamed in a specific topic. (tks Orange group)

roslaunch realsense2_camera rs_camera.launch align_depth:=true

ROS1 vs ROS2 commands cheatsheet

.bashrc ROS additions

# ROS
export ROS_LOCALHOST_ONLY=1
export PS1="\${ROS_VERSION:+(ros\$ROS_VERSION) }$PS1"
alias rosify1="source /opt/ros/noetic/setup.bash && source $HOME/ros1_ws/devel/setup.bash"
alias rosify2="source /opt/ros/iron/setup.bash && source $HOME/ros2_ws/install/setup.bash"

Flash kobuki

https://kobuki.readthedocs.io/en/devel/firmware.html#linux

ROS2 Package with custom Python Library

  • suppose we are in packge my-package

  • Inside the package folder my-package create a folder for my library. For example libs/my_lib

  • Inside myLib folder add __init__.py file that imports resources from other python files.

  • Add the CMakeList.txt

install( DIRECTORY libs/my_lib DESTINATION lib/${PROJECT_NAME})
  • build the package colcon build

More on ros2 tutorial by readthedocs:

Last updated