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

firmware error #35

Open
justinbar opened this issue Jul 2, 2023 · 17 comments
Open

firmware error #35

justinbar opened this issue Jul 2, 2023 · 17 comments

Comments

@justinbar
Copy link

when i compile the firmware teeny40 i keep on getting this error

Screenshot from 2023-07-02 02-53-30
Screenshot from 2023-07-02 02-53-30

@atticusrussell
Copy link
Contributor

use the galactic branch if you're on a different one currently. I ran into this issue yesterday and using galactic instead fixed it for me and worked fine with my other ros2 humble nodes.

@justinbar
Copy link
Author

so it doesn't work on foxy

@atticusrussell
Copy link
Contributor

The "galactic" branch of this repository works on ROS humble. I think it will on ROS foxy as well. The branch named "foxy" is broken.

@justinbar
Copy link
Author

how do i use the foxy branch, ros2 foxy is the only foxy i have right now

@atticusrussell
Copy link
Contributor

I don't believe the "foxy" branch of this repo works right now, but the "galactic" branch of this repo will likely work with the ROS Foxy on your system, regardless of the different names.

@justinbar
Copy link
Author

so i need to install ros 2 galactic to get galactic branch

@atticusrussell
Copy link
Contributor

no. Just checkout the "galactic" branch of this repository.

cd ~
git clone https://github.com/linorobot/linorobot2_hardware.git
cd linorobot2_hardware
git checkout galactic

@justinbar
Copy link
Author

when i use the galactic branch and try to run the firmware to my teensy40 i get this error
Screenshot from 2023-07-02 20-17-46
Screenshot from 2023-07-02 20-20-14

@atticusrussell
Copy link
Contributor

atticusrussell commented Jul 3, 2023

I see. I have a guess on how to fix it, but can't guarantee it will work because I haven't tested myself.

In firmware/platformio.ini, try changing
lib_deps = https://github.com/micro-ROS/micro_ros_platformio
to
lib_deps = https://github.com/micro-ROS/micro_ros_platformio#1.0.0
and then trying again.

Looking at last line of the the traceback, it mentions line 96 of
micro_ros_platformio/microros_utils/library_builder.py, which uses micro_ros_platformio/microros_utils/repositories.py. The .../repositories.py was updated 3 weeks ago and mentions deprecating foxy.

The change I'm asking you to make to firmware/platformio.ini should checkout a release of that repo from last year, which included foxy support.

This would also explain why it worked for me with humble and rolling, as those aren't deprecated by micro_ros_platformio.

Let me know how that goes, and I'll try to help troubleshoot further if needed.

@justinbar
Copy link
Author

it didn't work i got a lot of warning
Screenshot from 2023-07-02 21-55-09

@atticusrussell
Copy link
Contributor

I can reproduce your errors (galactic branch, ROS foxy WSL Ubuntu 20.04):

atticus@AJR-L5Pro:~/github/linorobot2_hardware/firmware  (galactic)
$ pio run -e teensy40
Processing teensy40 (board: teensy40; platform: teensy; framework: arduino)
---------------------------------------------------------------------------------------------------------------------------
Library Manager: Installing git+https://github.com/micro-ROS/micro_ros_platformio
git version 2.25.1
Cloning into '/home/atticus/.platformio/.cache/tmp/pkg-installing-9dd0chya'...
remote: Enumerating objects: 67, done.
remote: Counting objects: 100% (67/67), done.
remote: Compressing objects: 100% (51/51), done.
remote: Total 67 (delta 10), reused 31 (delta 5), pack-reused 0
Unpacking objects: 100% (67/67), 124.89 KiB | 1.07 MiB/s, done.
Library Manager: [email protected]+sha.35db5a9 has been installed!
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/teensy/teensy40.html
PLATFORM: Teensy (4.18.0) > Teensy 4.0
HARDWARE: IMXRT1062 600MHz, 512KB RAM, 1.94MB Flash
DEBUG: Current (jlink) External (jlink)
PACKAGES:
 - framework-arduinoteensy @ 1.158.0 (1.58)
 - tool-teensy @ 1.158.0 (1.58)
 - toolchain-gccarmnoneeabi-teensy @ 1.110301.0 (11.3.1)
Converting firmware.ino
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Installing catkin-pkg with pip at PlatformIO environment
/home/atticus/.platformio/penv/bin/python -m pip install catkin-pkg
Collecting catkin-pkg
  Using cached catkin_pkg-0.5.2-py3-none-any.whl (76 kB)
Collecting docutils (from catkin-pkg)
  Downloading docutils-0.20.1-py3-none-any.whl (572 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 572.7/572.7 kB 5.2 MB/s eta 0:00:00
Collecting python-dateutil (from catkin-pkg)
  Using cached python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
Collecting pyparsing (from catkin-pkg)
  Downloading pyparsing-3.1.0-py3-none-any.whl (102 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 102.6/102.6 kB 12.7 MB/s eta 0:00:00
Requirement already satisfied: setuptools in /home/atticus/.platformio/penv/lib/python3.8/site-packages (from catkin-pkg) (44.0.0)
Collecting six>=1.5 (from python-dateutil->catkin-pkg)
  Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Installing collected packages: six, pyparsing, docutils, python-dateutil, catkin-pkg
Successfully installed catkin-pkg-0.5.2 docutils-0.20.1 pyparsing-3.1.0 python-dateutil-2.8.2 six-1.16.0
Installing lark-parser with pip at PlatformIO environment
/home/atticus/.platformio/penv/bin/python -m pip install lark-parser
Collecting lark-parser
  Downloading lark_parser-0.12.0-py2.py3-none-any.whl (103 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 103.5/103.5 kB 1.9 MB/s eta 0:00:00
Installing collected packages: lark-parser
Successfully installed lark-parser-0.12.0
Installing empy with pip at PlatformIO environment
/home/atticus/.platformio/penv/bin/python -m pip install empy
Collecting empy
  Using cached empy-3.3.4-py3-none-any.whl
Installing collected packages: empy
Successfully installed empy-3.3.4
Installing colcon-common-extensions with pip at PlatformIO environment
/home/atticus/.platformio/penv/bin/python -m pip install colcon-common-extensions
Collecting colcon-common-extensions
  Using cached colcon_common_extensions-0.3.0-py3-none-any.whl (6.5 kB)
Collecting colcon-cmake (from colcon-common-extensions)
  Using cached colcon_cmake-0.2.27-py3-none-any.whl (25 kB)
Collecting colcon-core (from colcon-common-extensions)
  Using cached colcon_core-0.12.1-py3-none-any.whl (126 kB)
Collecting colcon-defaults (from colcon-common-extensions)
  Using cached colcon_defaults-0.2.8-py3-none-any.whl (10.0 kB)
Collecting colcon-devtools (from colcon-common-extensions)
  Using cached colcon_devtools-0.2.3-py3-none-any.whl (7.5 kB)
Collecting colcon-library-path (from colcon-common-extensions)
  Using cached colcon_library_path-0.2.1-py3-none-any.whl (4.9 kB)
Collecting colcon-metadata (from colcon-common-extensions)
  Using cached colcon_metadata-0.2.5-py3-none-any.whl (19 kB)
Collecting colcon-notification (from colcon-common-extensions)
  Using cached colcon_notification-0.2.15-py3-none-any.whl (63 kB)
Collecting colcon-output (from colcon-common-extensions)
  Using cached colcon_output-0.2.13-py3-none-any.whl (14 kB)
Collecting colcon-package-information (from colcon-common-extensions)
  Using cached colcon_package_information-0.3.3-py3-none-any.whl (15 kB)
Collecting colcon-package-selection (from colcon-common-extensions)
  Using cached colcon_package_selection-0.2.10-py3-none-any.whl (16 kB)
Collecting colcon-parallel-executor (from colcon-common-extensions)
  Using cached colcon_parallel_executor-0.2.4-py3-none-any.whl (5.5 kB)
Collecting colcon-powershell (from colcon-common-extensions)
  Using cached colcon_powershell-0.3.7-py3-none-any.whl (10 kB)
Collecting colcon-python-setup-py (from colcon-common-extensions)
  Using cached colcon_python_setup_py-0.2.8-py3-none-any.whl (11 kB)
Collecting colcon-recursive-crawl (from colcon-common-extensions)
  Using cached colcon_recursive_crawl-0.2.1-py3-none-any.whl (3.9 kB)
Collecting colcon-ros (from colcon-common-extensions)
  Using cached colcon_ros-0.3.23-py3-none-any.whl (25 kB)
Collecting colcon-test-result (from colcon-common-extensions)
  Using cached colcon_test_result-0.3.8-py3-none-any.whl (8.5 kB)
Collecting colcon-argcomplete (from colcon-common-extensions)
  Using cached colcon_argcomplete-0.3.3-py3-none-any.whl (6.9 kB)
Collecting colcon-bash (from colcon-common-extensions)
  Using cached colcon_bash-0.4.2-py3-none-any.whl (10 kB)
Collecting colcon-cd (from colcon-common-extensions)
  Using cached colcon_cd-0.1.1-py3-none-any.whl (3.6 kB)
Collecting colcon-zsh (from colcon-common-extensions)
  Using cached colcon_zsh-0.4.0-py3-none-any.whl (6.5 kB)
Collecting argcomplete (from colcon-argcomplete->colcon-common-extensions)
  Downloading argcomplete-3.1.1-py3-none-any.whl (41 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 41.5/41.5 kB 1.1 MB/s eta 0:00:00
Collecting distlib (from colcon-core->colcon-common-extensions)
  Using cached distlib-0.3.6-py2.py3-none-any.whl (468 kB)
Requirement already satisfied: EmPy in /home/atticus/.platformio/penv/lib/python3.8/site-packages (from colcon-core->colcon-common-extensions) (3.3.4)
Collecting pytest (from colcon-core->colcon-common-extensions)
  Downloading pytest-7.4.0-py3-none-any.whl (323 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 323.6/323.6 kB 4.8 MB/s eta 0:00:00
Collecting pytest-cov (from colcon-core->colcon-common-extensions)
  Downloading pytest_cov-4.1.0-py3-none-any.whl (21 kB)
Collecting pytest-repeat (from colcon-core->colcon-common-extensions)
  Using cached pytest_repeat-0.9.1-py2.py3-none-any.whl (4.3 kB)
Collecting pytest-rerunfailures (from colcon-core->colcon-common-extensions)
  Downloading pytest_rerunfailures-11.1.2-py3-none-any.whl (12 kB)
Requirement already satisfied: setuptools>=30.3.0 in /home/atticus/.platformio/penv/lib/python3.8/site-packages (from colcon-core->colcon-common-extensions) (44.0.0)
Collecting PyYAML (from colcon-defaults->colcon-common-extensions)
  Using cached PyYAML-6.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (701 kB)
Collecting notify2 (from colcon-notification->colcon-common-extensions)
  Using cached notify2-0.3.1-py2.py3-none-any.whl (8.0 kB)
Requirement already satisfied: catkin-pkg>=0.4.14 in /home/atticus/.platformio/penv/lib/python3.8/site-packages (from colcon-ros->colcon-common-extensions) (0.5.2)
Collecting colcon-pkg-config (from colcon-ros->colcon-common-extensions)
  Using cached colcon_pkg_config-0.1.0-py3-none-any.whl (4.5 kB)
Requirement already satisfied: docutils in /home/atticus/.platformio/penv/lib/python3.8/site-packages (from catkin-pkg>=0.4.14->colcon-ros->colcon-common-extensions) (0.20.1)
Requirement already satisfied: python-dateutil in /home/atticus/.platformio/penv/lib/python3.8/site-packages (from catkin-pkg>=0.4.14->colcon-ros->colcon-common-extensions) (2.8.2)
Requirement already satisfied: pyparsing in /home/atticus/.platformio/penv/lib/python3.8/site-packages (from catkin-pkg>=0.4.14->colcon-ros->colcon-common-extensions) (3.1.0)
Collecting iniconfig (from pytest->colcon-core->colcon-common-extensions)
  Using cached iniconfig-2.0.0-py3-none-any.whl (5.9 kB)
Requirement already satisfied: packaging in /home/atticus/.platformio/penv/lib/python3.8/site-packages (from pytest->colcon-core->colcon-common-extensions) (23.1)
Collecting pluggy<2.0,>=0.12 (from pytest->colcon-core->colcon-common-extensions)
  Downloading pluggy-1.2.0-py3-none-any.whl (17 kB)
Requirement already satisfied: exceptiongroup>=1.0.0rc8 in /home/atticus/.platformio/penv/lib/python3.8/site-packages (from pytest->colcon-core->colcon-common-extensions) (1.1.2)
Collecting tomli>=1.0.0 (from pytest->colcon-core->colcon-common-extensions)
  Using cached tomli-2.0.1-py3-none-any.whl (12 kB)
Collecting coverage[toml]>=5.2.1 (from pytest-cov->colcon-core->colcon-common-extensions)
  Downloading coverage-7.2.7-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (229 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 229.9/229.9 kB 18.4 MB/s eta 0:00:00
Requirement already satisfied: six>=1.5 in /home/atticus/.platformio/penv/lib/python3.8/site-packages (from python-dateutil->catkin-pkg>=0.4.14->colcon-ros->colcon-common-extensions) (1.16.0)
Installing collected packages: notify2, distlib, tomli, PyYAML, pluggy, iniconfig, coverage, argcomplete, pytest, pytest-rerunfailures, pytest-repeat, pytest-cov, colcon-core, colcon-zsh, colcon-test-result, colcon-recursive-crawl, colcon-python-setup-py, colcon-powershell, colcon-pkg-config, colcon-parallel-executor, colcon-package-selection, colcon-package-information, colcon-output, colcon-notification, colcon-metadata, colcon-library-path, colcon-devtools, colcon-defaults, colcon-bash, colcon-argcomplete, colcon-cmake, colcon-cd, colcon-ros, colcon-common-extensions
Successfully installed PyYAML-6.0 argcomplete-3.1.1 colcon-argcomplete-0.3.3 colcon-bash-0.4.2 colcon-cd-0.1.1 colcon-cmake-0.2.27 colcon-common-extensions-0.3.0 colcon-core-0.12.1 colcon-defaults-0.2.8 colcon-devtools-0.2.3 colcon-library-path-0.2.1 colcon-metadata-0.2.5 colcon-notification-0.2.15 colcon-output-0.2.13 colcon-package-information-0.3.3 colcon-package-selection-0.2.10 colcon-parallel-executor-0.2.4 colcon-pkg-config-0.1.0 colcon-powershell-0.3.7 colcon-python-setup-py-0.2.8 colcon-recursive-crawl-0.2.1 colcon-ros-0.3.23 colcon-test-result-0.3.8 colcon-zsh-0.4.0 coverage-7.2.7 distlib-0.3.6 iniconfig-2.0.0 notify2-0.3.1 pluggy-1.2.0 pytest-7.4.0 pytest-cov-4.1.0 pytest-repeat-0.9.1 pytest-rerunfailures-11.1.2 tomli-2.0.1
Installing importlib-resources with pip at PlatformIO environment
/home/atticus/.platformio/penv/bin/python -m pip install importlib-resources
Collecting importlib-resources
  Using cached importlib_resources-5.12.0-py3-none-any.whl (36 kB)
Collecting zipp>=3.1.0 (from importlib-resources)
  Using cached zipp-3.15.0-py3-none-any.whl (6.8 kB)
Installing collected packages: zipp, importlib-resources
Successfully installed importlib-resources-5.12.0 zipp-3.15.0
Installing pyyaml with pip at PlatformIO environment
/home/atticus/.platformio/penv/bin/python -m pip install pyyaml
Requirement already satisfied: pyyaml in /home/atticus/.platformio/penv/lib/python3.8/site-packages (6.0)
Installing pytz with pip at PlatformIO environment
/home/atticus/.platformio/penv/bin/python -m pip install pytz
Collecting pytz
  Using cached pytz-2023.3-py2.py3-none-any.whl (502 kB)
Installing collected packages: pytz
Successfully installed pytz-2023.3
Installing markupsafe==2.0.1 with pip at PlatformIO environment
/home/atticus/.platformio/penv/bin/python -m pip install markupsafe==2.0.1
Collecting markupsafe==2.0.1
  Downloading MarkupSafe-2.0.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (30 kB)
Installing collected packages: markupsafe
Successfully installed markupsafe-2.0.1
Configuring teensy40 with transport serial
Downloading micro-ROS dev dependencies
KeyError: 'foxy':
  File "/home/atticus/.platformio/penv/lib/python3.8/site-packages/platformio/builder/main.py", line 174:
    env.SConscript("$BUILD_SCRIPT")
  File "/home/atticus/.platformio/packages/tool-scons/scons-local-4.5.2/SCons/Script/SConscript.py", line 598:
    return _SConscript(self.fs, *files, **subst_kw)
  File "/home/atticus/.platformio/packages/tool-scons/scons-local-4.5.2/SCons/Script/SConscript.py", line 285:
    exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
  File "/home/atticus/.platformio/platforms/teensy/builder/main.py", line 162:
    target_elf = env.BuildProgram()
  File "/home/atticus/.platformio/packages/tool-scons/scons-local-4.5.2/SCons/Util/envs.py", line 242:
    return self.method(*nargs, **kwargs)
  File "/home/atticus/.platformio/penv/lib/python3.8/site-packages/platformio/builder/tools/piobuild.py", line 61:
    env.ProcessProjectDeps()
  File "/home/atticus/.platformio/packages/tool-scons/scons-local-4.5.2/SCons/Util/envs.py", line 242:
    return self.method(*nargs, **kwargs)
  File "/home/atticus/.platformio/penv/lib/python3.8/site-packages/platformio/builder/tools/piobuild.py", line 137:
    plb = env.ConfigureProjectLibBuilder()
  File "/home/atticus/.platformio/packages/tool-scons/scons-local-4.5.2/SCons/Util/envs.py", line 242:
    return self.method(*nargs, **kwargs)
  File "/home/atticus/.platformio/penv/lib/python3.8/site-packages/platformio/builder/tools/piolib.py", line 1180:
    project.install_dependencies()
  File "/home/atticus/.platformio/penv/lib/python3.8/site-packages/platformio/builder/tools/piolib.py", line 965:
    if _is_builtin(spec):
  File "/home/atticus/.platformio/penv/lib/python3.8/site-packages/platformio/builder/tools/piolib.py", line 957:
    for lb in self.env.GetLibBuilders():
  File "/home/atticus/.platformio/packages/tool-scons/scons-local-4.5.2/SCons/Util/envs.py", line 242:
    return self.method(*nargs, **kwargs)
  File "/home/atticus/.platformio/penv/lib/python3.8/site-packages/platformio/builder/tools/piolib.py", line 1093:
    lb = LibBuilderFactory.new(env, lib_dir)
  File "/home/atticus/.platformio/penv/lib/python3.8/site-packages/platformio/builder/tools/piolib.py", line 60:
    obj = globals()[clsname](env, path, verbose=verbose)
  File "/home/atticus/.platformio/penv/lib/python3.8/site-packages/platformio/builder/tools/piolib.py", line 153:
    self.process_extra_options()
  File "/home/atticus/.platformio/penv/lib/python3.8/site-packages/platformio/builder/tools/piolib.py", line 301:
    self.env.SConscript(
  File "/home/atticus/.platformio/packages/tool-scons/scons-local-4.5.2/SCons/Script/SConscript.py", line 598:
    return _SConscript(self.fs, *files, **subst_kw)
  File "/home/atticus/.platformio/packages/tool-scons/scons-local-4.5.2/SCons/Script/SConscript.py", line 285:
    exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
  File "/home/atticus/github/linorobot2_hardware/firmware/.pio/libdeps/teensy40/micro_ros_platformio/extra_script.py", line 157:
    build_microros()
  File "/home/atticus/github/linorobot2_hardware/firmware/.pio/libdeps/teensy40/micro_ros_platformio/extra_script.py", line 99:
    builder.run('{}/metas/{}'.format(main_path, selected_board_meta), cmake_toolchain.path, microros_user_meta)
  File "/home/atticus/github/linorobot2_hardware/firmware/.pio/libdeps/teensy40/micro_ros_platformio/microros_utils/library_builder.py", line 63:
    self.download_dev_environment()
  File "/home/atticus/github/linorobot2_hardware/firmware/.pio/libdeps/teensy40/micro_ros_platformio/microros_utils/library_builder.py", line 96:
    for repo in Sources.dev_environments[self.distro]:
=============================================== [FAILED] Took 13.36 seconds ===============================================

Environment    Status    Duration
-------------  --------  ------------
teensy40       FAILED    00:00:13.364
========================================== 1 failed, 0 succeeded in 00:00:13.364 ==========================================

After I make the change I suggested in firmware/platformio.ini, I get the following

atticus@AJR-L5Pro:~/github/linorobot2_hardware/firmware  (galactic)
$ pio run -e teensy40
Processing teensy40 (board: teensy40; platform: teensy; framework: arduino)
---------------------------------------------------------------------------------------------------------------------------
Removing unused dependencies...
Library Manager: Removing micro_ros_platformio @ 0.0.1+sha.35db5a9
Library Manager: [email protected]+sha.35db5a9 has been removed!
Library Manager: Installing git+https://github.com/micro-ROS/micro_ros_platformio#1.0.0
git version 2.25.1
Cloning into '/home/atticus/.platformio/.cache/tmp/pkg-installing-84msg42b'...
remote: Enumerating objects: 67, done.
remote: Counting objects: 100% (67/67), done.
remote: Compressing objects: 100% (51/51), done.
remote: Total 67 (delta 11), reused 36 (delta 5), pack-reused 0
Unpacking objects: 100% (67/67), 125.24 KiB | 1.39 MiB/s, done.
Note: switching to '2aef8a2b5d2dc3a0efe89b5985cb2ada6fdab846'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

Library Manager: [email protected]+sha.2aef8a2 has been installed!
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/teensy/teensy40.html
PLATFORM: Teensy (4.18.0) > Teensy 4.0
HARDWARE: IMXRT1062 600MHz, 512KB RAM, 1.94MB Flash
DEBUG: Current (jlink) External (jlink)
PACKAGES:
 - framework-arduinoteensy @ 1.158.0 (1.58)
 - tool-teensy @ 1.158.0 (1.58)
 - toolchain-gccarmnoneeabi-teensy @ 1.110301.0 (11.3.1)
Converting firmware.ino
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Installing pyyaml with pip at PlatformIO environment
/home/atticus/.platformio/penv/bin/python -m pip install pyyaml
Requirement already satisfied: pyyaml in /home/atticus/.platformio/penv/lib/python3.8/site-packages (6.0)
Installing markupsafe==2.0.1 with pip at PlatformIO environment
/home/atticus/.platformio/penv/bin/python -m pip install markupsafe==2.0.1
Requirement already satisfied: markupsafe==2.0.1 in /home/atticus/.platformio/penv/lib/python3.8/site-packages (2.0.1)
Configuring teensy40 with transport serial
Downloading micro-ROS dev dependencies
         - Downloaded ament_cmake
         - Downloaded ament_lint
         - Downloaded ament_package
         - Downloaded googletest
         - Downloaded ament_cmake_ros
         - Downloaded ament_index
Building micro-ROS dev dependencies
Downloading micro-ROS library
         - Downloaded microcdr
         - Downloaded microxrcedds_client
         - Downloaded rcl
         - Downloaded rcl_yaml_param_parser (ignored)
         - Downloaded rcl_lifecycle
         - Downloaded rcl_action
         - Downloaded rclc_lifecycle
         - Downloaded rclc
         - Downloaded rclc_parameter
         - Downloaded rclc_examples (ignored)
         - Downloaded rcutils
         - Downloaded micro_ros_msgs
         - Downloaded rmw_microxrcedds
         - Downloaded rosidl_typesupport_cpp (ignored)
         - Downloaded rosidl_typesupport_c
         - Downloaded rosidl_typesupport_microxrcedds_c
         - Downloaded rosidl_typesupport_microxrcedds_cpp_tests
         - Downloaded rosidl_typesupport_microxrcedds_test_msg
         - Downloaded rosidl_typesupport_microxrcedds_c_tests
         - Downloaded rosidl_typesupport_microxrcedds_cpp (ignored)
         - Downloaded tinydir_vendor
         - Downloaded rosidl_typesupport_introspection_cpp (ignored)
         - Downloaded rosidl_parser
         - Downloaded rosidl_cmake
         - Downloaded rosidl_typesupport_introspection_c (ignored)
         - Downloaded rosidl_runtime_c
         - Downloaded rosidl_runtime_cpp (ignored)
         - Downloaded rosidl_typesupport_interface
         - Downloaded rosidl_adapter
         - Downloaded rosidl_generator_cpp (ignored)
         - Downloaded rosidl_generator_c
         - Downloaded rmw_implementation_cmake
         - Downloaded rmw
         - Downloaded composition_interfaces
         - Downloaded builtin_interfaces
         - Downloaded lifecycle_msgs
         - Downloaded test_msgs
         - Downloaded action_msgs
         - Downloaded rcl_interfaces
         - Downloaded statistics_msgs
         - Downloaded rosgraph_msgs
         - Downloaded rosidl_default_runtime
         - Downloaded rosidl_default_generators
         - Downloaded unique_identifier_msgs
         - Downloaded actionlib_msgs
         - Downloaded std_msgs
         - Downloaded stereo_msgs
         - Downloaded shape_msgs
         - Downloaded common_interfaces
         - Downloaded nav_msgs
         - Downloaded diagnostic_msgs
         - Downloaded std_srvs
         - Downloaded geometry_msgs
         - Downloaded trajectory_msgs
         - Downloaded visualization_msgs
         - Downloaded sensor_msgs_py
         - Downloaded sensor_msgs
         - Downloaded test_interface_files
         - Downloaded test_rmw_implementation
         - Downloaded rmw_implementation
         - Downloaded rcl_logging_spdlog (ignored)
         - Downloaded rcl_logging_log4cxx (ignored)
         - Downloaded rcl_logging_noop
         - Downloaded tracetools_test
         - Downloaded ros2trace
         - Downloaded tracetools_launch
         - Downloaded tracetools
         - Downloaded tracetools_trace
         - Downloaded tracetools_read
         - Extra packages folder not found, skipping...
Building micro-ROS library
Found 99 compatible libraries
Scanning dependencies...
Dependency Graph
|-- micro_ros_platformio @ 0.0.1+sha.2aef8a2
|-- encoder
|-- imu
|-- kinematics
|-- motor
|-- odometry
|-- pid
Building in release mode
Compiling .pio/build/teensy40/src/firmware.ino.cpp.o
Compiling .pio/build/teensy40/lib208/micro_ros_platformio/platform_code/arduino/clock_gettime.cpp.o
Compiling .pio/build/teensy40/lib208/micro_ros_platformio/platform_code/arduino/serial/micro_ros_transport.cpp.o
Compiling .pio/build/teensy40/lib4ee/encoder/encoder.cpp.o
Compiling .pio/build/teensy40/libc16/Wire/Wire.cpp.o
Compiling .pio/build/teensy40/libc16/Wire/WireIMXRT.cpp.o
Compiling .pio/build/teensy40/libc16/Wire/WireKinetis.cpp.o
In file included from /home/atticus/github/linorobot2_hardware/firmware/src/firmware.ino:32:
lib/odometry/odometry.h:19:10: fatal error: micro_ros_utilities/type_utilities.h: No such file or directory
   19 | #include <micro_ros_utilities/type_utilities.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Compiling .pio/build/teensy40/libc16/Wire/utility/twi.c.o
Compiling .pio/build/teensy40/libdb1/imu/ADXL345.cpp.o
Compiling .pio/build/teensy40/libdb1/imu/HMC5883L.cpp.o
Compiling .pio/build/teensy40/libdb1/imu/I2Cdev.cpp.o
Compiling .pio/build/teensy40/libdb1/imu/ITG3200.cpp.o
Compiling .pio/build/teensy40/libdb1/imu/MPU6050.cpp.o
Compiling .pio/build/teensy40/libdb1/imu/MPU9150.cpp.o
Compiling .pio/build/teensy40/libdb1/imu/MPU9250.cpp.o
*** [.pio/build/teensy40/src/firmware.ino.cpp.o] Error 1
Compiling .pio/build/teensy40/liba2a/kinematics/kinematics.cpp.o
lib/imu/MPU9250.cpp: In member function 'bool MPU9250::writeMemoryBlock(const uint8_t*, uint16_t, uint8_t, uint8_t, bool, bool)':
lib/imu/MPU9250.cpp:2999:14: warning: 'progBuffer' may be used uninitialized in this function [-Wmaybe-uninitialized]
 2999 |     uint8_t *progBuffer;
      |              ^~~~~~~~~~
lib/imu/MPU9250.cpp:3025:23: warning: 'verifyBuffer' may be used uninitialized in this function [-Wmaybe-uninitialized]
 3025 |         if (verify && verifyBuffer) {
      |                       ^~~~~~~~~~~~
lib/imu/MPU9250.cpp: In member function 'bool MPU9250::writeDMPConfigurationSet(const uint8_t*, uint16_t, bool)':
lib/imu/MPU9250.cpp:3104:81: warning: 'progBuffer' may be used uninitialized in this function [-Wmaybe-uninitialized]
 3104 |                 if (sizeof(progBuffer) < length) progBuffer = (uint8_t *)realloc(progBuffer, length);
      |                                                                          ~~~~~~~^~~~~~~~~~~~~~~~~~~~
lib/imu/MPU9150.cpp: In member function 'bool MPU9150::writeMemoryBlock(const uint8_t*, uint16_t, uint8_t, uint8_t, bool, bool)':
lib/imu/MPU9150.cpp:3020:23: warning: 'verifyBuffer' may be used uninitialized in this function [-Wmaybe-uninitialized]
 3020 |         if (verify && verifyBuffer) {
      |                       ^~~~~~~~~~~~
============================================== [FAILED] Took 205.42 seconds ==============================================

Environment    Status    Duration
-------------  --------  ------------
teensy40       FAILED    00:03:25.425
========================================== 1 failed, 0 succeeded in 00:03:25.425 ==========================================

I'll try to troubleshoot further

@atticusrussell
Copy link
Contributor

I got it to compile after some more troubleshooting. This repo needs some work to support different ROS distros and test them - I'll try to get that working if I can get PRs merged. In the meantime, @justinbar here's the workaround:

I found this existing issue #13
and followed it.

my firmware/platformio.ini looks like this (in the relevant section):

[env]
platform = teensy
framework = arduino
upload_port = /dev/ttyACM0
upload_protocol = teensy-cli
board_microros_transport = serial
board_microros_distro = ${sysenv.ROS_DISTRO}
lib_deps =
  https://github.com/micro-ROS/micro_ros_platformio#1.0.0
  https://github.com/micro-ROS/micro_ros_utilities
build_flags = -I ../config

I didn't change anything above or below - just changed lib_deps
I then did the following, which you may even be able to just paste and have it work.

cd ~
git clone -b $ROS_DISTRO https://github.com/ros2/rosidl.git
cp -r rosidl/rosidl_typesupport_introspection_c linorobot2_hardware/firmware/.pio/libdeps/teensy40/
cd linorobot2_hardware/firmware/
pio run -e teensy40

this worked for me:

atticus@AJR-L5Pro:~/github/linorobot2_hardware/firmware  (galactic)
$ pio run -e teensy40
Processing teensy40 (board: teensy40; platform: teensy; framework: arduino)
---------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/teensy/teensy40.html
PLATFORM: Teensy (4.18.0) > Teensy 4.0
HARDWARE: IMXRT1062 600MHz, 512KB RAM, 1.94MB Flash
DEBUG: Current (jlink) External (jlink)
PACKAGES:
 - framework-arduinoteensy @ 1.158.0 (1.58)
 - tool-teensy @ 1.158.0 (1.58)
 - toolchain-gccarmnoneeabi-teensy @ 1.110301.0 (11.3.1)
Converting firmware.ino
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Installing pyyaml with pip at PlatformIO environment
/home/atticus/.platformio/penv/bin/python -m pip install pyyaml
Requirement already satisfied: pyyaml in /home/atticus/.platformio/penv/lib/python3.8/site-packages (6.0)
Installing markupsafe==2.0.1 with pip at PlatformIO environment
/home/atticus/.platformio/penv/bin/python -m pip install markupsafe==2.0.1
Requirement already satisfied: markupsafe==2.0.1 in /home/atticus/.platformio/penv/lib/python3.8/site-packages (2.0.1)
Configuring teensy40 with transport serial
micro-ROS already built
Found 101 compatible libraries
Scanning dependencies...
Dependency Graph
|-- micro_ros_platformio @ 0.0.1+sha.2aef8a2
|-- micro_ros_utilities @ 0.0.0+20230703120900.sha.5f1cead
|-- encoder
|-- imu
|-- kinematics
|-- motor
|-- odometry
|-- pid
Building in release mode
Compiling .pio/build/teensy40/src/firmware.ino.cpp.o
Compiling .pio/build/teensy40/lib3c7/micro_ros_utilities/type_utilities.c.o
.pio/libdeps/teensy40/micro_ros_utilities/src/type_utilities.c: In function 'print_type_info':
.pio/libdeps/teensy40/micro_ros_utilities/src/type_utilities.c:96:61: warning: format '%u' expects argument of type 'unsigned int', but argument 7 has type 'uint32_t' {aka 'long unsigned int'} [-Wformat=]
   96 |       buffer, sizeof(buffer), "%sIntrospection for %s/%s - %u members, %zu B\n",
      |                                                            ~^
      |                                                             |
      |                                                             unsigned int
      |                                                            %lu
......
  100 |       members->member_count_,
      |       ~~~~~~~~~~~~~~~~~~~~~~
      |              |
      |              uint32_t {aka long unsigned int}
Compiling .pio/build/teensy40/lib66f/odometry/odometry.cpp.o
/home/atticus/github/linorobot2_hardware/firmware/src/firmware.ino: In function 'bool destroyEntities()':
/home/atticus/github/linorobot2_hardware/firmware/src/firmware.ino:222:23: warning: ignoring return value of 'rcl_ret_t rcl_publisher_fini(rcl_publisher_t*, rcl_node_t*)' declared with attribute 'warn_unused_result' [-Wunused-result]
  222 |     rcl_publisher_fini(&odom_publisher, &node);
      |     ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
/home/atticus/github/linorobot2_hardware/firmware/src/firmware.ino:223:23: warning: ignoring return value of 'rcl_ret_t rcl_publisher_fini(rcl_publisher_t*, rcl_node_t*)' declared with attribute 'warn_unused_result' [-Wunused-result]
  223 |     rcl_publisher_fini(&imu_publisher, &node);
      |     ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
/home/atticus/github/linorobot2_hardware/firmware/src/firmware.ino:224:26: warning: ignoring return value of 'rcl_ret_t rcl_subscription_fini(rcl_subscription_t*, rcl_node_t*)' declared with attribute 'warn_unused_result' [-Wunused-result]
  224 |     rcl_subscription_fini(&twist_subscriber, &node);
      |     ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
/home/atticus/github/linorobot2_hardware/firmware/src/firmware.ino:225:18: warning: ignoring return value of 'rcl_ret_t rcl_node_fini(rcl_node_t*)' declared with attribute 'warn_unused_result' [-Wunused-result]
  225 |     rcl_node_fini(&node);
      |     ~~~~~~~~~~~~~^~~~~~~
/home/atticus/github/linorobot2_hardware/firmware/src/firmware.ino:226:19: warning: ignoring return value of 'rcl_ret_t rcl_timer_fini(rcl_timer_t*)' declared with attribute 'warn_unused_result' [-Wunused-result]
  226 |     rcl_timer_fini(&control_timer);
      |     ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
Linking .pio/build/teensy40/firmware.elf
Checking size .pio/build/teensy40/firmware.elf
Calculating size .pio/build/teensy40/firmware.elf
Building .pio/build/teensy40/firmware.hex
teensy_size: Memory Usage on Teensy 4.0:
teensy_size:   FLASH: code:116140, data:10428, headers:8596   free for files:1896452
teensy_size:    RAM1: variables:34368, code:114024, padding:17048   free for local variables:358848
teensy_size:    RAM2: variables:12416  free for malloc/new:511872
=============================================== [SUCCESS] Took 3.35 seconds ===============================================

Environment    Status    Duration
-------------  --------  ------------
teensy40       SUCCESS   00:00:03.349
=============================================== 1 succeeded in 00:00:03.349 ===============================================

@justinbar
Copy link
Author

think you it worked! so far I was able to drive my robot around. This project need to be up to date due these type of errors.

@atticusrussell
Copy link
Contributor

Glad to have helped! And agreed - there are a number of issues to be resolved. I only found this repo recently myself, but I made PR #34 to begin automatic testing for stuff like this, and if it gets merged by this repo's owner I plan to move on to fixes for issues like this.

@atticusrussell
Copy link
Contributor

atticusrussell commented Aug 26, 2023

@justinbar can you try checking out the updated foxy branch, pulling in changes, and confirm if it works now? Shouldn't need to tinker with anything.

If it does work, do you mind closing this issue? Thanks !

@justinbar
Copy link
Author

it worked for foxy branch

@atticusrussell
Copy link
Contributor

@justinbar Wonderful. Can you close the issue?

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