Ask Your Question

using asio in a ros2 package

asked 2021-10-13 18:38:50 -0500

sameh4 gravatar image

I am looking for a sanity check on this idea from more experienced developers.

ros2 is installed on an Nnvidia TX1 using a docker container of the ros galactic release. The container runs a c++ ros2 package with the asio library working as a socket server, listening on port 9090 for example.

Messages come in on port 9090 from the web browser of an Android device; or any web browser really. Messages sent to 9090 from the browser are in JSON format and contain linear and angular velocity. The code bound to the socket then creates a Twist message with these values and publishes them on cmd_vel.

There is also a micro-ros agent running on the TX1 that forwards the cmd_vel to a micro-ros instance running on an ESP32 board that is connected to the motor driver.

I am basically trying to create a simple remote control interface from the android phone without having to bother with ros2-java or building an Android app.

I already turned the TX1 WiFi interface into an access point and connected to it from the phone.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2021-10-13 18:47:11 -0500

I'd say that's pretty rational. Depending on your needs on the microcontroller, I might even suggest just removing ROS 2 from the equation completely. I wouldn't bother converting to Twist just to pass things around unless you're leveraging some other tools (like TF) that expect it to be in a particular data format to operate on.

edit flag offensive delete link more



Thanks for the quick reply! I want to use ros2 for practice of TF, diff drive control loop, IMU sensor, and monocular SLAM.

sameh4 gravatar image sameh4  ( 2021-10-13 19:42:20 -0500 )edit

Makes sense then.

stevemacenski gravatar image stevemacenski  ( 2021-10-14 13:09:07 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2021-10-13 18:38:50 -0500

Seen: 48 times

Last updated: Oct 13 '21