Setup Raspberry PI 4 with CORE2-ROS

Hello,

I am trying to configure Raspberry PI 4 SBC with CORE2-ROS controller (modified with new resistors supporting I2C at the end 2019). Talking about ROSBOT.
I know you guys are not supporting RPI 4 yet, so I am installing everything in there from scratch, including the following:

As result, RPi.GPIO test works, ROS Noetic works with rviz, rgt_graph.

However I could not establish serial communications with CORE2-ROS with following error:
[INFO] [1641958937.312490]: ROS Serial Python Node
[INFO] [1641958937.329470]: Connecting to /dev/serial1 at 525000 baud
[ERROR] [1641958937.338039]: Error opening serial: [Errno 13] could not open port /dev/serial1: [Errno 13] Permission denied: ‘/dev/serial1’

Also, I have few questions to make sure that all required packages installed properly.

  • Do you have procedure or documentation describing which packages should be installed from scratch if you are not using pre-packaged images? As far as I know (and I tested as well), ASUS Tinker Board full images provided by Husarion don’t work on RPI.
  • Should CORE2-ROS firmware for ROS Noetic work with RPI as is?
  • You also you mentioned about docker containers that might work on RPI and Tinker. From the Husarion · GitHub or Docker Hub which one’s do you recommend installing on RPI 4?

Thank you very much!

Hi lsradets.

Sorry for late response. You are lucky because we are currently testing raspberry, and we had exactly the same problems with CORE as you have right now. Fortunately, we solve them. You have to make few changes in /boot/firmware/config.txt. I will send you more details on Monday. We haven’t finished transitions yet, so I can’t promise everything will work.

In case of other questions:

  • Any docker container should work with raspberry as long as it was built for arm64. As I remember, all of them were built that way, so everything should work just fine. Some of them were even tested on this platform.
  • CORE2 firmware is related to ROS distro, not SBC, so it will work just fine. Docker images have their own CORE firmware, so you will need to flash a new one if you plan to use docker. With working UART it will be the same procedure as always.
  • An last question, but in revers order from yours - the software. Chroot for Up Board and for TInker Board are all you need. We recently moved our build system to github, so now you can check what exactly what is in our systems. Those scripts have everything we are customizing. If you want to stick to bare minimum, a docker will be all you need.

Other changes you have already done make sense and I hope you will make it running.

Best regards,
Krzysztof Wojciechowski.

Thank you Krzysztof_Woj ! I will be waiting for the good solutions :wink:
I think it will be great for the whole RPI community!
Best,
Leo

Hi lsradets

In order to communicate RPI with CORE2 follow these steps:

  • Setup GPIO:

    • sudo gropuadd gpio
    • sudo adduser $USER gpio
    • pip3 install RPi.GPIO
  • Modify U-Boot

  • The simlink /dev/serial0 should refer to /dev/ttyAMA0 otherwise it will be impossible to flash CORE2 using uart pins.

  • Edit the cmdline.txt file. Remove the console=serial0,115200 entry and make sure enable_uart=1 is set.

  • Add dtoverlay=disable-bt to usercfg.txt

  • Run sudo systemctl disable hciuart

All the above steps should allow you to flash CORE2 from Rapsberry Pi 4. Like I said before. I can’t promise it will 100% work, so I will really appreciate your feedback. Also, sorry for once again pointing steps you have already done, but it’s better for other people to have everything as step by step instruction.

Edit: corrected errors pointed in message below

Best regards,
Krzysztof Wojciechowski

Thank you very much for your quick reply!
Couple of things to mention.

  1. There is a typo in the first 2 lines in Setup GPIO of your reply (not big deal, just to make it clean for people who will be copy these lines :grinning_face_with_smiling_eyes: ). It should read:

Setup GPIO:

  • sudo groupadd gpio
  • sudo adduser $USER gpio
  • pip3 install RPi.GPIO
  1. In my RPI configuration I have simlink /dev/serial1 → ttyAMA0
    husarion@husarion:/boot$ ls -l /dev/se*
    crw-rw----+ 1 root audio 14, 1 Dec 10 04:04 /dev/sequencer
    crw-rw----+ 1 root audio 14, 8 Dec 10 04:04 /dev/sequencer2
    lrwxrwxrwx 1 root root 7 Dec 10 04:04 /dev/serial1 → ttyAMA0

  2. My cmdline.txt and usercfg.txt located in /boot/firmware directory. Please see below.

husarion@husarion:/boot/firmware$ nano cmdline.txt
net.ifnames=0 dwc_otg.lpm_enable=0 console=tty1 root=LABEL=writable rootfstype=ext4 elevator=deadline rootwait fixrtc quiet splash

  1. I modified it, and it looks now:
    husarion@husarion:/boot/firmware$ nano cmdline.txt
    net.ifnames=0 dwc_otg.lpm_enable=0 console=tty1 root=LABEL=writable rootfstype=ext4 elevator=deadline rootwait fixrtc quiet splash

    enable_uart=1

  2. I ran sudo systemctl disable hciuart and then restarted RPI and CORE2
    husarion@husarion:/boot/firmware$ sudo systemctl disable hciuart
    Removed /etc/systemd/system/multi-user.target.wants/hciuart.service.

  3. After power Off / On I observed the following:

  • husarion@husarion:~$ sudo python3 gpio_test.py
    LR1 yellow LED was flashing 10 times - test passed

  • And I lost port and simlink /dev/serial1 → ttyAMA0 now it’s /dev/serial1 → ttyS0:
    husarion@husarion:/boot$ ls -l /dev/ser*
    lrwxrwxrwx 1 root root 7 Dec 10 04:04 /dev/serial1 → ttyS0

    As result I can not test sudo stm32loader -c rpi -f F4 -p /dev/serial1:
    husarion@husarion:sudo stm32loader -c rpi -f F4 -p /dev/serial1
    Could not configure port

  • Before I make changes to cmdline.txt and usercfg.txt when I executed
    husarion@husarion:sudo stm32loader -c rpi -f F4 -p /dev/serial1
    LR1 yelow LED was lit solid yellow, no command output, until I pressed CTRL-C to stop it. So I guess, at least telling me that port /dev/serial1 existed, but misconfigured.
    Now after new configuration I lost it. Just a thought…

Please let me know your thoughts

Thanks so much,
Leo

Hi lsradets

I am sorry for that late response, but I had a really busy week. So far I send you what I got from our internal tests. Can we postpone setting it up to the next week, so I will get my hands on Raspberry Pi as well? I will be preparing a script for automated build of ubuntu core so in the end it should be just a matter of running a bash script on a fresh system.

I also edited my message to what you pointed out. Thanks for the catch!

Best regards,
Krzysztof Wojciechowski.

Thank you, Krzysztof!
It would be a great idea to use scripted build. This way we will avoid mistakes, typos and most important we don’t need to keep track of optimized Ubuntu installation for RPI, ROS setup / configuration, additional software installation / tweaking. Everything will be consistent if we need to re-build or troubleshoot. Another advantage would be for educational or debugging purposes, we will be able to read the script and install packages manually line by line as well!

So looking forward to the automated script!!!

Thanks again,
Leo

Hi lsradets

I am terribly sorry for such late response, but recently, I was really busy. Here is a script that I test on Ubuntu Core. It set up everything from disabling unnecessary hardware to creating symlinks. Eventually, we gave up building u-boot from scratch for simply disabling it. Keep in mind to run everything as root.

echo "
# disable u-boot and boot directly to kernel
kernel=vmlinuz
initramfs initrd.img followkernel
# disable wifi
dtoverlay=disable-wifi
dtoverlay=disable-bt
# enable usb-C as host
dtoverlay=dwc2,dr_mode=host
# prevent overvolting
never_over_voltage=1
# speed up boot by disabling unnececery options
disable_poe_fan=1
disable_splash=1
boot_delay=0
# enable uart
enable_uart=1
" >> /boot/firmware/config.txt

# remove forced serial baudrate
sed -i "s/console=serial0,115200//g" /boot/firmware/cmdline.txt

# create simlink from /dev/ttyAMA0 to /dev/serial0
touch /etc/udev/rules.d/99_serial0.rules
echo 'KERNEL=="ttyAMA0", SYMLINK+="serial0"' >> /etc/udev/rules.d/99_serial0.rules
udevadm control --reload-rules
udevadm trigger

# disable bluetooth service
systemctl disable hciuart

# install GPIO python library
pip3 install RPi.GPIO

# give access to GPIO
chown root.gpio /dev/gpiomem
chmod g+rw /dev/gpiomem

[EDIT]
Keep in mind that dtoverlay=disable-wifi will disable onboard wifi in raspberry pi.

Best regards.
Krzysztof Wojciechowski.

Hello Krzysztof,

Thank you very much for the update!
I understand you are working on multiple projects not only on this one :grinning_face_with_smiling_eyes: , but I am sure together we will get to the end of it :wink:
So, I ran the script your proposed, seems it executed properly with no errors, thank you!
My observations.

  1. sudo stm32loader -c rpi -f F4 works now!
    Bootloader version: 0x31
    Chip id: 0x413 (STM32F405xx/07xx and STM32F415xx/17xx)
    Device UID: 0045-0029-414D500F-20353243
    Flash size: 1024 KiB

  2. Serial ports seems configured properly now (/dev/serial0, serial_baudrate=525000):
    usarion@husarion:~/ros_workspace$ ls -l /dev/ser
    lrwxrwxrwx 1 root root 7 Jan 9 23:56 /dev/serial0 → ttyAMA0
    lrwxrwxrwx 1 root root 5 Jan 9 23:56 /dev/serial1 → ttyS0

usarion@husarion:~/ros_workspace$ *udevadm info -a -n /dev/serial0
looking at device ‘/devices/platform/soc/fe201000.serial/tty/ttyAMA0’:
KERNEL==“ttyAMA0”
SUBSYSTEM==“tty”
DRIVER==""

  1. However still having issues with serial communications. When executing
    roslaunch rosbot_ekf all.launch I’ve got error:
    [INFO] [1644013795.639176]: ROS Serial Python Node
    [INFO] [1644013795.656222]: Connecting to /dev/serial0 at 525000 baud
    [ERROR] [1644013795.669995]: Error opening serial: [Errno 13] could not open port /dev/serial0: [Errno 13] Permission denied: '/dev/serial0’

  2. I am using COR2-ROS firmware rosbot-2.0-fw-v0.14.3-noetic.bin

Another question. Can we enable WI-FI in config.txt? The script disabled it.

dtoverlay=disable-wifi

When you get a chance please let me know your thoughts.

Thank you very much,
Leo

Hi lsradets.

I am so sorry about the wifi I just didn’t realize I kept it inside the script. I will keep it in there anyway because running the internal wifi inside rosbot is not a good idea because of the metal enclosure. In the office we are testing everything with USB wifi cards connected external antennas.

As for no access to serial port run

adduser $USER tty
adduser $USER dialout

This will permanently add your user to a group with access to the serial port.
The other walk around is to run:

chmod 666 /dev/serial0

but it will only be a temporal solution.

Hello Krzysztof,

Thank you very much for the updates!
I think using USB WIFI adapter with external antenna is a great idea.
Adding $USER to tty and dialout groups resolved access to /dev/serial0 port
We are moving ahead slowly but surely :smiley: , thank you for your help!
Now when I executed roslaunch rosbot_ekf all.launch I’ve got the following error:

ERROR] [1644182627.097022]: Cannot import package : rosbot_ekf
[ERROR] [1644182627.106389]: sys.path was [’/opt/ros/noetic/lib/rosserial_python’, ‘/home/husarion/ros_workspace/devel/lib/python3/dist-packages’, ‘/opt/ros/noetic/lib/python3/dist-packages’, ‘/usr/lib/python38.zip’, ‘/usr/lib/python3.8’, ‘/usr/lib/python3.8/lib-dynload’, ‘/home/husarion/.local/lib/python3.8/site-packages’, ‘/usr/local/lib/python3.8/dist-packages’, ‘/usr/local/lib/python3.8/dist-packages/stm32loader-0.5.0-py3.8.egg’, ‘/usr/lib/python3/dist-packages’, ‘/usr/lib/python3.8/dist-packages’]
[ERROR] [1644182627.111543]: Creation of publisher failed: ‘NoneType’ object has no attribute 'msg’

So for information for troubleshooting. Prior to all this I installed rosbot_ekf with the following steps:

cd ~/ros_workspace/src 
catkin_init_workspace 
git clone https://github.com/husarion/rosbot_ekf.git 
cd ~/ros_workspace 
catkin_make 
source devel/setup.sh  
cd ~/ros_workspace/src/rosbot_ekf/launch 
nano rosserial_bridge.launch

Then I modified rosserial_bridge.launch with the serial port parameters

serial_port" default="/dev/serial0"
arg name="serial_baudrate" default="525000"

Then I executed:

cd ~/ros_workspace 
source devel/setup.sh  
roslaunch rosbot_ekf all.launch

And got the error shown above.

Did I miss something with configuration?

Thank you very much,
Leo

Hi lsradets

That’s odd… The errors seems like it comes from python… Maybe sourcing ROS once again will somehow fix this. Could you run both (assuming you are using bash and not sh):

source /opt/ros/$ROS_DISTRO/setup.bash
source ~/ros_workspace/devel/setup.bash

To check if your system is recognizing the package run:

rospack list | grep rosbot

The output should look similar to this:
rosbot_ekf /home/husarion/ros_workspace/src/rosbot_ekf

Best regards,
Krzysztof Wojciechowski.

Hello Krzysztof,

Thanks for your reply! You were right, before I was sourcing setup.sh not setup.bash
So following your recommendation this time I executed both

source /opt/ros/$ROS_DISTRO/setup.bash
source ~/ros_workspace/devel/setup.bash

and then i checked

rospack list | grep rosbot

and I 've got

rosbot_ekf /home/husarion/ros_workspace/src/rosbot_ekf

which is correct.

However, I still get the same error when executed
husarion@husarion:~/ros_workspace$ roslaunch rosbot_ekf all.launch

ERROR] [1644182627.097022]: Cannot import package : rosbot_ekf
[ERROR] [1644182627.106389]: sys.path was [’/opt/ros/noetic/lib/rosserial_python’, ‘/home/husarion/ros_workspace/devel/lib/python3/dist-packages’, ‘/opt/ros/noetic/lib/python3/dist-packages’, ‘/usr/lib/python38.zip’, ‘/usr/lib/python3.8’, ‘/usr/lib/python3.8/lib-dynload’, ‘/home/husarion/.local/lib/python3.8/site-packages’, ‘/usr/local/lib/python3.8/dist-packages’, ‘/usr/local/lib/python3.8/dist-packages/stm32loader-0.5.0-py3.8.egg’, ‘/usr/lib/python3/dist-packages’, ‘/usr/lib/python3.8/dist-packages’]
[ERROR] [1644182627.111543]: Creation of publisher failed: ‘NoneType’ object has no attribute 'msg’

Do you you think I might missed some Python3 packages related to rosbot_ekf? Or missed other packages? Or missed something in the path?

husarion@husarion:~/ros_workspace$ echo $PATH

/opt/ros/noetic/bin:/home/husarion/.local/lib/python3.8/site-packages:/home/husarion/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

husarion@husarion:~/ros_workspace/devel$ printenv | grep ROS -i
ROS_VERSION=1
PKG_CONFIG_PATH=/home/husarion/ros_workspace/devel/lib/pkgconfig:/opt/ros/noetic/lib/pkgconfig
ROS_PYTHON_VERSION=3
ROS_PACKAGE_PATH=/home/husarion/ros_workspace/src:/opt/ros/noetic/share
ROSLISP_PACKAGE_DIRECTORIES=/home/husarion/ros_workspace/devel/share/common-lisp
PWD=/home/husarion/ros_workspace/devel
ROS_ETC_DIR=/opt/ros/noetic/etc/ros
CMAKE_PREFIX_PATH=/home/husarion/ros_workspace/devel:/opt/ros/noetic
PYTHONPATH=/home/husarion/ros_workspace/devel/lib/python3/dist-packages:/opt/ros/noetic/lib/python3/dist-packages
ROS_MASTER_URI=http://localhost:11311
LD_LIBRARY_PATH=/home/husarion/ros_workspace/devel/lib:/opt/ros/noetic/lib
PATH=/opt/ros/noetic/bin:/home/husarion/.local/lib/python3.8/site-packages:/home/husarion/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
ROS_ROOT=/opt/ros/noetic/share/ros
ROS_DISTRO=noetic
OLDPWD=/home/husarion/ros_workspace

I would appreciate your thoughts or recommendations!

Thanks
Leo

Hi lsradets.

I think the issue might be related to no messages being published on the start of the rosserial, so it doesn’t have initialized the message. I just realized the same issue happens writing the own python nodes.

Basically, at this point my personal recommendation would be to run everything from within the docker container. You will have everything running the same way as it is in our case. With firmware for Melodic this docker container should work fine (Flash firmware script does not work for raspberry pi yet. You will have to run flash command manually). It will also work with ROS noetic on the host machine.

Best regards,
Krzysztof Wojciechowski.

Hello Krzysztof,

Thanks for the info and suggestions!
For me It’s kind of hard to understand why there is such a big difference for rosserial messaging on software / python level for Tinker Board and RPI, these SBCs seems very similar from high level perspective :wink:
Before I will proceed with your recommendations, I would need to start digging into setting docker containers, so if you don’t mind I would like to ask couple of clarifying questions.

  1. Do I need to re-deploy Ubuntu 18.04 on RPI host when using Husarion rosbot-docker, or I can still use Ubuntu 20.04 Mate with the same docker images? Do you have URLs or doc for setting up all Husarion rosbot-docker packages from the scratch, including docker engine?

  2. When you say It will also work with ROS Noetic on the host machine, do you mean same docker containers on Ubuntu 20.04 host with ROS Noetic?

  3. Also I a have a bit another hypothetical question :grinning_face_with_smiling_eyes:. Is it make sense to purchase ASUS Tinker Board? It’s become outdated 32 bit model and it is not widely available now? I am asking this because you might have plans to update it to the newer ASUS Tinker Board 2 and we would need to purchase another model soon and probably new controller as well. What are you plans or thoughts for that? I believe this is very important for Rosbot platform long term support and maintenance.

  4. Honestly, I am a big fan of Raspberry PI, its well supported and I really wish to continue using it for Rosbot. Also it seems ASUS Tinker Board does not have much support for Ubuntu based distributions, it has its own custom build OS which is harder to customize and maintain. What are your thoughts on that? Do you have plans to fully support Raspberry PI platform in the nearest future?

Thank you very much for all your help and patience,
Leo

Hi lsradets.

At least in docker there was no difference between those boards, that is why I was doing it this way. Your issue might come from some setup inside your system, and it is much safer to set up everything inside docker since we will know you have everything running exactly the same as we do. In terms of your questions:

  1. You can keep your host system exactly as it is. The best part of docker, you can run any Ubuntu distro inside docker on any Ubuntu host machine. In order to set up docker follow this guide and later to configure your user follow this one. Personally, I think this should be the best way to install docker.
  2. I meant that you can have any ROS distro inside docker and after setting it up with network_mode: host in docker-compose topics from within docker container should be able to talk with anything you have on your host system.
  3. We don’t know yet what we will settle on due to the global problem with basically any SBC, so I can’t give you any exact answer. Basically, we will be moving away from 32 ARM, but this needs some time due to tests and development involved into this process.
  4. We are supporting Raspberry Pi in our other robot Panther. If it ends up being in Rosbot 2.0. We will see.

Best regards,
Krzysztof Wojciechowki.

Hello Krzysztof,

Thank you very much for additional information!
I am preparing for docker containers implementation.
Per my personal understanding how rosbot-docker structured I am going to proceed with following:

  1. Install Docker Engine and Docker Composer - Install Docker Engine | Docker Documentation
  2. Pull husarion/rosbot repository - docker pull husarion/rosbot
  3. Tweak docker-compose.yaml with ROS Noetic references (since I have ROS Noetic already installed on the host. Not sure if I should leave ROS Melodic in docker-compose.yaml as is instead.
  4. Execute docker-compose up
  5. Still not sure if I need to execute docker buildx build
  6. Run docker and see if I can communicate with CORE2-ROS - docker run rosbot

Please let me know if this is correct logic, since I don’t see much details on docker configuration and execution on Husarion site, so I am using general docker resources :wink:.
I am thinking when we done with ROSbot 2 / Raspberry PI 4 configuration, I can create a simple cheat sheet with steps required to configure RPI 4 + Docker from scratch for basic operations. This will help community who just started with Husarion robotics create the base for experiments with RPI 4 and CORE2-ROS

Thank you very much,
Leo

Hi lsradets.

So far, our documentation about usage of docker with ROS is being slowly created. That is why now we are assuming a person starting with that already knows a little bit of docker.

The best example of what you can base your configuration on is in out nav2 demo. You can get rid of nav2 docker and what you are left with are Melodic-based docker containers. They should communicate with Noetic on your host without any problem.

And responding to your questions:

  1. I am sorry. I completely forgot about docker-compose. It is also needed to be installed.
  2. You can pull it manually, but docker-compose will do it as well if it won’t find a matching image.
  3. I mentioned tweaking above. Basically, our docker containers are based on Melodic, and they will work with Noetic with ease.
  4. You can skip step 2 with that.
  5. Buildx is needed if you want to build a docker, for example for ARM64 on AMD64. Our docker containers are prebuilt for ARM64 already. If you are building docker on Raspberry Pi that is intended to run on it, you can simply run docker build. Buildx is used for cross-platform builds.
  6. docker-compose is equivalent of docker run with entire configuration inside a nice yaml file.

To sum up. All you need is to run docker-compose up and to wait for magic to happen. :slight_smile:

The instruction you mentioned will be a nice final touch to our discussion.

Best regards,
Krzysztof Wojciechowski.

Thank you very much, Krzysztof!
I will start working on implementing Docker and let you know how it works.

Best,
Leo

I’ve got good and bad news :smiley:.
Good news first.

  1. I successfully installed Docker engine (v20.10.12) and compose (v2.2.2). With compose we have to be careful since I believe compose on ARM architecture works only from version 2.0 and up, so I installed v2.2.2
    sudo curl -L "https://github.com/docker/compose/releases/download/v2.2.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
  2. To load most of the containers, I used “full” configuration of docker-compose.yaml, even i did not connect RPLidar and Orbec Astra camera.

docker-compose.yaml

version: "2.3"


services:

  # ROS Foxy Rviz2 VNC
  rviz2:
    image: husarion/ros2-desktop-vnc:latest
    restart: on-failure
    ports: 
      - 6080:80
    volumes:
      - ./rosbot_pro.rviz:/root/.rviz2/default.rviz
    shm_size: '512m'


  # ROS Noetic + ROS 2 Foxy
  bridge:
    image: ros:foxy-ros1-bridge
    restart: on-failure
    environment:
      - "ROS_IP=bridge"
      - "ROS_MASTER_URI=http://my-ros-master:11311"    
    command: ros2 run ros1_bridge dynamic_bridge


  # ROS Melodic master
  my-ros-master:
    image: ros:melodic-ros-core
    restart: on-failure
    tty: true 
    environment:
      - "ROS_IP=my-ros-master"
      - "ROS_MASTER_URI=http://my-ros-master:11311"    
    command: stdbuf -o L roscore


  # ROS Melodic rosbot hardware layer
  rosbot:
    image: husarion/rosbot:latest
    tty: true      
    environment:
      - "ROS_IP=rosbot"
      - "ROS_MASTER_URI=http://my-ros-master:11311"
    restart: on-failure
    environment:
      - "SERIAL_PORT=/dev/serial0" # default: ttyS1 - rosbot2.0; ttyS4 - rosbot2.0 `pro
    devices:
      - "/dev/serial0"   # must match environment SERIAL_PORT 
    command: roslaunch rosbot_description rosbot_docker.launch


  # ROS Melodic Rplidar
  rplidar:
    image: husarion/rplidar:latest
    restart: unless-stopped
    environment:
      - "ROS_IP=rplidar"
      - "ROS_MASTER_URI=http://my-ros-master:11311"
    devices:
      - /dev/ttyUSB0
    tty: true      
    command: roslaunch rplidar_ros rplidar_a3.launch # For Rosbot 2.0 PRO use roslaunch rplidar_ros rplidar_a3.launch


  # ROS Melodic Orbbec Astra docker
  astra:
    image: husarion/astra:latest
    restart: unless-stopped
    environment:
      - "ROS_IP=astra"
      - "ROS_MASTER_URI=http://my-ros-master:11311"
    devices:
      - /dev/bus/usb/001/006
    tty: true        
    command: roslaunch astra_camera astra.launch
  1. I have to start roscore on RPI host in order to communicate between docker containers and ROS Noetic on RPI host

The bad news.
Unfortunately, I still got similar error as before ( Cannot import package : rosbot_ekf ) when executing sudo docker-compose up .
Please note, to temporary simplify process, I did not configure yet non-root user to manage docker, so I am using sudo for now. Here is an error:

rosbot-rosbot-1  | [ERROR] [1645051414.730609]: Cannot import package : rosbot_ekf
rosbot-rosbot-1  | [ERROR] [1645051414.738589]: sys.path was ['/app/ros_ws/src/rosbot_description/src/rosbot_description/scripts/rosbot_description', '/app/ros_ws/devel/lib/python2.7/dist-packages', '/opt/ros/melodic/lib/python2.7/dist-packages', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-aarch64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages/wx-3.0-gtk3']
rosbot-rosbot-1  | [ERROR] [1645051414.748617]: Creation of publisher failed: 'NoneType' object has no attribute 'msg'
rosbot-rosbot-1  | [INFO] [1645051414.760736]: Setup publisher on buttons [std_msgs/UInt8]
rosbot-rosbot-1  | process[laser_publisher-5]: started with pid [89]
rosbot-rosbot-1  | [ERROR] [1645051415.010076]: Tried to publish before configured, topic id 126
rosbot-rosbot-1  | [INFO] [1645051415.015094]: Requesting topics...
rosbot-rosbot-1  | [ERROR] [1645051415.039774]: Creation of publisher failed: Checksum does not match: 476f837fa6771f6e16e3bf4ef96f8770,4ddae7f048e32fda22cac764685e3974

Something still misconfigured. I even tried to run docker-compose.yaml with only 2 containers as copied below and still get the same error above ( Cannot import package : rosbot_ekf ). I borrowed my docker-compose.yaml from nav2-docker:

docker-compose.yaml

version: "2.3"

services:

  # ROS Noetic + ROS 2 Foxy
  bridge:
    image: ros:foxy-ros1-bridge
    restart: on-failure
    network_mode: host
    ipc: host
    environment:
      - "ROS_IP=127.0.0.1"
      - "ROS_MASTER_URI=http://127.0.0.1:11311"
      - "ROS_DOMAIN_ID=0"
    command: ros2 run ros1_bridge dynamic_bridge


  # ROS Melodic rosbot hardware layer
  rosbot:
    image: husarion/rosbot
    tty: true      
    restart: on-failure
    network_mode: host
    environment:
      - "ROS_IP=127.0.0.1"
      - "ROS_MASTER_URI=http://127.0.0.1:11311"
      - "SERIAL_PORT=/dev/serial0" # default: ttyS1 - rosbot2.0; ttyS4 - rosbot2.0 `pro
    devices:
      - "/dev/serial0"   # must match environment SERIAL_PORT 
    command: roslaunch rosbot_description rosbot_docker.launch

Your thoughts would be greatly appreciated!

Thank you very much,
Leo