3pi+2040 ROS Integration

I have successfully integrated the 3Pi+2040 with the ROS robot operating system, but I have some concerns structuring the project for re-distribution.

To do this I forked the micro ROS implementation for the Raspberry Pi Pico and adapted it to the 3pi+ 2040. Then I added a bit of the battery reading code from the Pololu 3pi+ 2040 git repo and created a new ROS publisher. Now I can see the battery status over a ros2 topic. I wrote a blog post about that here.

I don’t know if this is the right forum to discuss this, but I’m having difficulty structuring the project in a way that I could feel comfortable re-distributing it. Rather than manually copying code over from the pololu git repo into the forked micro ROS project, I’d like a more modular approach. Furthermore, manually copying code over leaves attribution of the code in a tenuous position.

I’d prefer something like linking against the Pololu code as a library. I know that code is still in flux (Hi David!). I’d like to entreat the developers to structure that code in a way that makes linking as a library possible. If this is already possible, I ask for some hints on how to do that.

I plan to develop this out to include remote control of the 3pi+ motors using ROS2 using a Playstation controller. Eventually it might be cool to add full remote capability using a Wixel. I’ll be posting updates to my blog as I work through this problem.



That sounds very cool :+1: Are your plans to run the main ROS node on something like a RasperryPi SBC that’s sitting on top of the 3π+ or using some kind of remote connection like WiFi, BLE, etc to communicate between ROS nodes?

Hello, Peter!

Thanks for trying out the 3pi+ 2040 and getting ROS to work on it!

I looked at your fork of the micro_ros_raspberrypi_pico_sdk repository. If you want to redistribute our code, all we are asking is that you preserve the license; copying LICENSE.txt into the pololu_3pi_2040_robot directory in your fork would make it fine with us. But if there’s some technical problem with that we could also consider releasing it some other way if that helps.

If you do not want to redistribute our code, you might consider integrating our library the same way micro-ROS integrates with the Pico SDK: the user could set an environment variable and then you could use that variable to add our library. You would have something like this in CMakeLists.txt:

add_subdirectory($ENV{POLOLU_3PI_2040_ROBOT_PATH}/c/pololu_3pi_2040_robot pololu_3pi_2040_robot)

Please let me know if you have any further questions.