Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error during build #9

Open
gglaspell opened this issue Feb 22, 2023 · 6 comments
Open

error during build #9

gglaspell opened this issue Feb 22, 2023 · 6 comments

Comments

@gglaspell
Copy link

gglaspell commented Feb 22, 2023

In the section https://github.com/gentijo/RosBots/blob/22f02a6dcb213eed83f05fffdc22b8cff248d093/README.md#compile-the-esp32-code-from-within-the-container the instructions points to the /opt/microros/bots/maqueen-esp32, but that directory doesn't exist. I assume the correct directory is /opt/rosbots/microros_ws/assemblies/esp32-range-buggy.

However, when I run idf.py build in the esp32-range-buggy directory, I get the following error:
/opt/rosbots/microros_ws/components/app/ros/microros_app_base.h:10:10: fatal error: rcl/rcl.h: No such file or directory
#include <rcl/rcl.h>
^~~~~~~~~~~
compilation terminated.
ninja: build stopped: subcommand failed.
ninja failed with exit code 1

I think I am stuck; any help would be greatly appreciated. I really want to flash my mbits ESP32 board.

@gentijo
Copy link
Owner

gentijo commented Feb 22, 2023

Hi @gglaspell. the range-buggy and joystick-bit projects won't compile right now, there is probably a tag on the main line branch that will build those projects. Back in Dec I started incorporating MicroPython to MicroROS, The micropython branch will compile but it still needs a lot of work. Look at the mptest project. Currently it builds a working test, the serial port will emit messages from a ROS timer, it will also present a Micropython REPL prompt i.e. ">>>" and you can type python commands, try help(). The Thonny IDE will connect and give you a proper editor and supports code up/down load. Other shortcomings currently are, IP address of the micro ros agent is hard coded in the sdkconfig, also the ROS Init code needs more error detection, if the agent is not running the watchdog timer will reset the code every min. Lots of work to do still, stay tuned for updates.

@gglaspell
Copy link
Author

@gentijo Thank you for your prompt reply. I am really interested in microROS and this project seems like a good entry point. I tried compiling the mptest project, but I am getting a compile error specifically:

MicroPy Port Dir is /opt/rosbots/microros_ws/extern/micropython/ports/esp32
CMake Error at /opt/rosbots/microros_ws/components/esp32/micropython/CMakeLists.txt:17 (message):
  Invalid MICROPY_BOARD specified: GENERIC
Call Stack (most recent call first):
  CMakeLists.txt:13 (include)


-- Configuring incomplete, errors occurred!
See also "/opt/rosbots/microros_ws/assemblies/mptest/build/CMakeFiles/CMakeOutput.log".
cmake failed with exit code 1

I believe the compilation is failing here: https://github.com/gentijo/RosBots/blob/bedb80ae694d8b27ed7caf0ae3f65b61b9474496/microros_ws/components/esp32/micropython/CMakeLists.txt#L16

Also, if it helps, I do not have any subfolders below /extern/micropython/

@gentijo
Copy link
Owner

gentijo commented Feb 22, 2023

In the root of the project type
git submodule init
git submodule update

I have incorperated Micropython as a git submodule this is also why the the older pure microROS apps don't compile because I am in the process of changing the cmake files to treat microROS as a git submodule also, vs always checking out the master branch. This way I can pin everything to specific versions.

@gglaspell
Copy link
Author

@gentijo using submodules is pretty clever, since I wouldn't want to pull again after building the docker image.
when running git submodule init I get the following error fatal: No url found for submodule path 'micropython' in .gitmodules. I also tried cloning with the --recurse-submodules flag. Running ls -a isn't showing .gitmodules in the list.

@gentijo
Copy link
Owner

gentijo commented Feb 27, 2023

@gglaspell it should compile now from the main line branch but after pulling you need to do the following
in project root

git submodule init
git submodule update -- recursive

cd microros_ws/libs/micropython
git submodule init
git submodule update --recursive

It may complain about a missing include dir, just create it. The cmake build system needs a bunch of work, especially around the MicroRos build, I don't think it needs all the micro_ros_dev ament scripts and get rid of all the git clone statements in libmicroros.mk.

Thonny should be able to connect to the mbits board either over the serial port or via web sockets (WenREPL) but the webRepl connection I think has a line ending issue and it executes commands on time out vs line ending so it feels slow but really isn't

Hopefully in the next week or two I will have MPython hooked up to the ROS subsystem and fixed webRepl.

@gglaspell
Copy link
Author

gglaspell commented Mar 3, 2023

@gentijo Thank you for your latest commit! I was able to compile mptest successfully. I was really happy to see:

Project build complete. To flash, run this command:
/opt/esp/python_env/idf4.3_py3.6_env/bin/python ../../../../esp/idf/components/esptool_py/esptool/esptool.py -p (PORT) -b 460800 --before default_reset --after hard_reset --chip esp32  write_flash --flash_mode dio --flash_size detect --flash_freq 40m 0x1000 build/bootloader/bootloader.bin 0x8000 build/partition_table/partition-table.bin 0x10000 build/mptest.bin
or run 'idf.py -p (PORT) flash'

Thanks again for you help and guidance.

I was able to flash the board with 'mptest'. However I had to first remove brltty from my host system to get the Mbits ESP32 board to show up as /dev/ttyUSB0. I also added --group-add dialout \ to the startNode.sh.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants