Coder Social home page Coder Social logo

Comments (19)

kevinEberson avatar kevinEberson commented on August 17, 2024 1

I tried a couple of things, but I keep running into some issues with either the file path or shutil not recognizing the file path. My expertise is more in lower-level languages like C. I changed the "init" function of the Build class to the following implementation:

    def __init__(self, library_folder, packages_folder, distro, python_env):
        self.library_folder = '"' + os.path.normcase(library_folder) + '"'
        self.packages_folder = '"' + os.path.normcase(packages_folder) + '"'
        self.build_folder = '"' + os.path.normcase(os.path.join(library_folder, "build").replace('"', '')) + '"'
        self.distro = distro

        self.dev_packages = []
        self.mcu_packages = []

        self.dev_folder = '"' + os.path.normcase(os.path.join(self.build_folder, 'dev').replace('"', '')) + '"'
        self.dev_src_folder = '"' + os.path.normcase(os.path.join(self.dev_folder, 'src').replace('"', '')) + '"'
        self.mcu_folder = '"' +  os.path.normcase(os.path.join(self.build_folder, 'mcu').replace('"', '')) + '"'
        self.mcu_src_folder = '"' + os.path.normcase(os.path.join(self.mcu_folder, 'src').replace('"', '')) + '"'

        self.library_path = '"' + os.path.normcase(os.path.join(library_folder, 'libmicroros').replace('"', '')) + '"'
        self.library = '"' + os.path.normcase(os.path.join(self.library_path, "libmicroros.a").replace('"', '')) + '"'
        self.includes = '"' + os.path.normcase(os.path.join(self.library_path, 'include').replace('"', '')) + '"'
        self.library_name = "microros"
        self.python_env = python_env
        self.env = {}

It seems a bit hacky, but without a pretty major redesign it does not seem a very easy change to me. Perhaps someone with more knowledge about the package and Python could up with a better fix. My implementation formats the paths correctly, but shutil does not recognize the path anymore (No such file or directory, while it does exists). I am kind of short on time due to some school projects, so dedicating time right now is a bit hard. Perhaps I could look into it at a later date When I have more time available. For now, warn people about using Windows style file paths/ file path with spaces as this breaks the build script. If you have any questions, feel free to ask :)

from micro_ros_platformio.

hippo5329 avatar hippo5329 commented on August 17, 2024 1

This issue is not specific to esp32. Though it is possible to run ROS2 Jazzy on Windows, it is difficult for beginners. Docker is popular in ROS development.

Platformio and Arduino have minor different micro-ROS implementation. So it won't work to just insert the Arduino library.

VScode is a much powerful IDE than Arduino IDE. If you have pi4/5, it would be better to run vscode on Windows and ssh to Pi. Check my wiki,

https://github.com/hippo5329/micro_ros_arduino_examples_platformio/wiki#development-on-windows-or-linux-desktop-and-use-vscode-remote-development-ssh-to-rpi45

from micro_ros_platformio.

hippo5329 avatar hippo5329 commented on August 17, 2024 1

The micro_ros_platformio uses ardunio framework. You can use most of the arduino drivers and libraries. The arduino libraries will be built from source. So it will more flexible than the pre-built arduino library.

from micro_ros_platformio.

pablogs9 avatar pablogs9 commented on August 17, 2024

Hello @kevinEberson are you using Plaform.IO in a Windows environment?

from micro_ros_platformio.

kevinEberson avatar kevinEberson commented on August 17, 2024

Hi @pablogs9, I am running platfromIO on Ubuntu Linux 22.04 LTS. I managed to get the example to work, however when trying to apply micro-ros to another project, I get this error.

from micro_ros_platformio.

pablogs9 avatar pablogs9 commented on August 17, 2024

What are the differences between those two projects? Could determine exactly the change that makes micro-ROS fail in the clone procedure?

from micro_ros_platformio.

kevinEberson avatar kevinEberson commented on August 17, 2024

For testing purposes, I commented all code, and copied the implementation of the platformio.ini and main.c file to the project from the micro-ros example. In theory, everything should be the same but I still get the error as mentioned.

from micro_ros_platformio.

pablogs9 avatar pablogs9 commented on August 17, 2024

Could you add a print(command) after this line:

command = "git clone -b {} {} {}".format(self.branch, self.url, self.path)

To check which is the git command?

from micro_ros_platformio.

kevinEberson avatar kevinEberson commented on August 17, 2024

the resulting git command output is as following:

git clone -b humble https://github.com/ament/ament_cmake /media/kevin/Git drive/git/autonomous-guided-vehicle-platform-3/RIGS-Core/RIGS-Motorcontrol/.pio/libdeps/esp32dev/micro_ros_platformio/build/dev/src/ament_cmake

prehaps the error is caused by the space in the path? I will try to validate myself.

from micro_ros_platformio.

pablogs9 avatar pablogs9 commented on August 17, 2024

Yes, it seems that this space is not smelling well.

Could you check if adding a couple of quotes solves the problem? If it does, could you open a PR with the solution? It would be highly appreciated.

from micro_ros_platformio.

kevinEberson avatar kevinEberson commented on August 17, 2024

Formatting folder and self.name as a str() solves the issue in my case. The formatting of the filepath seems to be the issue here. I will look into fixing this in a proper way and create a PR to fix the issue.

from micro_ros_platformio.

pablogs9 avatar pablogs9 commented on August 17, 2024

Cool, thanks for contributing!

from micro_ros_platformio.

MojitoShader avatar MojitoShader commented on August 17, 2024

@kevinEberson
Where/how do you open up the Build class? (How can I modify that stuff) I am running into this problem for ever now and I have no Idea how to fix it. It occurs on Windows and with WSL soooo.
(Lol, so this Problem is still here and nobody fixed it)
Thx for the help, cheers

from micro_ros_platformio.

hippo5329 avatar hippo5329 commented on August 17, 2024

Windows/WSL will not build. You should use docker or virtualbox to run ubuntu 22.04 and humble. If you have pi4/5, you may vscode/ssh to edit on windows and compile on Pi.

from micro_ros_platformio.

hippo5329 avatar hippo5329 commented on August 17, 2024

https://docs.ros.org/en/humble/How-To-Guides/Run-2-nodes-in-single-or-separate-docker-containers.html

from micro_ros_platformio.

MojitoShader avatar MojitoShader commented on August 17, 2024

Thanks for the help, I'll try that next.
Is this just a ESP32 Problem or generally mircoRos?
So the solution is to use the ArduinoIDE 🤢 (wich is able to compile the Example) or VS Code on Ubuntu.
I tried to use the Arduino library as zip in PlatformIO but that didn't work either. Any Idea why that doesn't work?
I think that would be a nice workaround (Normally Arduino libs are mostly compatible with PIO)

from micro_ros_platformio.

MojitoShader avatar MojitoShader commented on August 17, 2024

It's coming together now.
The learning curve is pretty steep. But at least I can compile and do stuff now. Thanks for the help. @hippo5329
I think it would be great to have your Example next to the ESP32 / have examples next to the supported Hardware.
(Here: https://github.com/micro-ROS/micro_ros_platformio) (Or have a examples sub Site)
It so easy to get lost in all the possibilities and versions of ROS / micro_ros.
(I don't know if that makes sense in a git-project manner..)
I am working on a simple esp32 robot (SLAM) with a replacement lidar for vacuum cleaners from Aliexpress.
(They are available for less than 20$$ )

from micro_ros_platformio.

hippo5329 avatar hippo5329 commented on August 17, 2024

It is a good idea to use cheap vacuum cleaner as a robot base. I recalled that irobot did it before. If you are going to do slam with esp32, you may check another wiki.

linorobot2_hardware firmware for mobile robots

from micro_ros_platformio.

hippo5329 avatar hippo5329 commented on August 17, 2024

About the various ROS2 releases, I am moving to the current LTS stable Jazzy. I will let you know when ready. One of the reason is Pi 5, which is supported with Ubuntu 24.04 but not 22.04. Pi 5 is much faster than Pi 4. The price of them are close. Pi 5 should be considered for new purchase.

from micro_ros_platformio.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.