micro-ROS / micro-ROS_sensors_demo

Provides a demo of micro-ROS based on ST Disco L475 IOT01 board.
Apache License 2.0
12 stars 3 forks source link

command `docker-compose run stiot_builder` fails #6

Closed altineller closed 3 years ago

altineller commented 3 years ago

Hello,

it seems that command docker-compose run stiot_builder is failing, because of not finding pip.

How can I get around to this bug?

Best regards, -Can

/usr/bin/python3: No module named pip /usr/bin/python3: No module named pip executing command [apt-get install -y ninja-build] executing command [apt-get install -y gperf] executing command [apt-get install -y dfu-util] executing command [apt-get install -y wget] executing command [apt-get install -y gcc-multilib] executing command [apt-get install -y g++-multilib] executing command [apt-get install -y openocd] executing command [python3 -m pip install -U west] ERROR: the following rosdeps failed to install pip: command [python3 -m pip install -U west] failed ERROR: Service 'stiot_builder' failed to build: The command '/bin/sh -c . /opt/ros/$ROS_DISTRO/setup.sh && . ./install/setup.sh && apt update && ros2 run micro_ros_setup create_firmware_ws.sh zephyr discovery_l475_iot1 && rm -rf /var/lib/apt/lists/*' returned a non-zero code: 1

pablogs9 commented 3 years ago

I have added a794303e30b5c5c0a1f1df6ca48e0c366a94e27c, please let me know if now it works.

altineller commented 3 years ago

Hello,

It did fail with the same error, not being able to find pip. But I added the pip install in the docker file as:

FROM microros/base:foxy

RUN apt update && apt install -y \
    python3-pip

RUN . /opt/ros/$ROS_DISTRO/setup.sh \
&&  . ./install/setup.sh \
&&  apt update \
&&  ros2 run micro_ros_setup create_firmware_ws.sh zephyr discovery_l475_iot1 \
&&  rm -rf /var/lib/apt/lists/*

COPY ./entrypoint.sh /

ENTRYPOINT ["/entrypoint.sh"]
CMD ["bash"]

and it did work. I was able to build, configure and flash the firmware.

Then I proceeded with the rest of the instructions and I got an error saying that it could not find ros-dashing-desktop,

which then I modified the micro-ROS_sensors/dockerfile/rqt/Dockerfile to:

FROM ros:foxy

RUN apt update \
&&  apt install -y ros-foxy-desktop \
&&  rm -rf /var/lib/apt/lists/*

WORKDIR /
COPY ./src ./src

COPY ./entrypoint.sh /
ENTRYPOINT ["/entrypoint.sh"]
CMD ["bash"]

this allowed me to pass the ros-dashing not found error, but this time I got an an interactive kb configuration screen, which no matter what I entered it would not go to next step. I think it is not accepting any inputs as TERM is not set.

debconf: (TERM is not set, so the dialog frontend is not usable.)
debconf: falling back to frontend: Readline
Configuring keyboard-configuration
----------------------------------

The layout of keyboards varies per country, with some countries having multiple
common layouts. Please select the country of origin for the keyboard of this
computer.

  1. Afghani
  2. Albanian
  3. Amharic
  4. Arabic
  5. Arabic (Morocco)

also I made an LXD configuration profile, that has ubuntu 20.04 and ros foxy, and I tried installing, but was hit with many dependencies again. I interested in preparing and LXD config, that will hold the microros environment, once I get this one running.

Best Regards, and thank you for the great work. -can

altineller commented 3 years ago

I found the solution to the previous problem: in the rqt/dockerfile

adding: DEBIAN_FRONTEND=noninteractive before rosinstall

RUN apt update \ && DEBIAN_FRONTEND=noninteractive apt install -y ros-foxy-desktop \ && rm -rf /var/lib/apt/lists/*

And I had to change setup.bash to setup.sh in two scripts.

Unfortunately, running the docker-compose up, leads to no rqt display.

I also run a shell on the agent container, and ros2 topic listed, and I did not see any topics except /rosout

I am working on getting it up without docker, and I faced other problems, but I will write a new issue tomorrow.

I think the setup procedure is a little outdated, I volunteer to write-up on how to make it work, once I get it working. :)

Best regards, C.

pablogs9 commented 3 years ago

Ok, I have:

Regarding the sharing screen between docker and host. Have you done a xhost + in your computer before launching the docker? Read here

altineller commented 3 years ago

I tested the latest version.

Firmware creation, configuration and flashing, works. docker-compose -d up completes without any problem but no rqt window opens.

At one place I got the error warning below, but I doubt it is relevant.

ERROR: junit2html 30.0.4 has requirement jinja2>=2.11.2, but you'll have jinja2 2.10.1 which is incompatible.

I have checked it is not a xwindows error, by attaching to the rqt container, installing x11-apps and running xclock. It works. Notice: I had to change the display in docker-compose.yml to unix:1 in order to get xclock working correctly. (I am on ubuntu20.04, with and I probably have unix:1 because I am using a gpu with dual windows? (speculating here)

environment: DISPLAY: unix:1


I am also translating your docker setup to LXD, which I will post in a while.

pablogs9 commented 3 years ago

Any update on this?

altineller commented 3 years ago

@pablogs9 yes it works now and the instructions are ok too.