micro-ROS / micro-ROS/micro_ros_arduino

Arduino for Ping on BlueROV

Open
#1,352 3 comments 0 reactions 1 assignee View on GitHub

@Acuadros95 is already working on this.

Since Mar 23, 2023.

Dominant language
C
Stars
576
Forks
146
PR merge metrics
No merged PRs in 30d

Description

Hi everyone,

- Hardware Type: Arduino DUE
- Installation type: micro_ros_setup
- Version or commit hash: galactic
- Script on Arduino DUE: [example publisher](https://github.com/micro-ROS/micro_ros_arduino/blob/humble/examples/micro-ros_publisher/micro-ros_publisher.ino)

Premise: I asked the same question on the BlueRobotics forum ([here](https://discuss.bluerobotics.com/t/ping-with-arduino-using-micro-ros-possible/13911)), but unfortunately, I didn't get an answer -> I am doing something wrong on the micro ROS side.

I copy here the content:

Using ROS 2 on my laptop, I want to communicate with an Arduino DUE (with micro ROS running on it) connected to the companion computer of a BlueROV (Raspberry Pi 3 with a Pixhawk running [ArduSub](https://www.ardusub.com/)).

After setting up micro ROS on my Arduino DUE and testing the serial communication on my laptop (following [this](https://roboticsknowledgebase.com/wiki/interfacing/microros-for-ros2-on-microcontrollers/) tutorial), I confirmed that everything is working ok:

```shell
$ ros2 run micro_ros_agent micro_ros_agent serial --dev /dev/ttyACM0 -b 115200 -v6
[1678973917.856675] info | TermiosAgentLinux.cpp | init | running... | fd: 3
[1678973917.857069] info | Root.cpp | set_verbose_level | logger setup | verbose_level: 6
[1678973935.542156] info | Root.cpp | create_client | create | client_key: 0x0793D525, session_id: 0x81
[1678973935.542255] info | SessionManager.hpp | establish_session | session established | client_key: 0x0793D525, address: 0
[1678973935.542397] debug | SerialAgentLinux.cpp | send_message | [** <> **] | client_key: 0x0793D525, len: 19, data:
0000: 81 00 00 00 04 01 0B 00 00 00 58 52 43 45 01 00 01 0F 00
```
For what it's worth, I also tested the UDP connection in the [first application linux tutorial](https://micro.ros.org/docs/tutorials/core/first_application_linux/)

The next steps were:

1. connect the Arduino to the companion computer
2. create the serial port (baud rate _115200_) and the UDP port (_192.168.2.2:8888_) using the [routing procedure](https://www.ardusub.com/reference/companion/routing.html) recommended by them
3. communicate with the Arduino through the UDP using micro ROS on my topside laptop

But something is wrong:

```shell
$ ros2 run micro_ros_agent micro_ros_agent udp4 --ip 192.168.2.1 --port 8888
[1678974517.990334] info | UDPv4AgentLinux.cpp | init | running... | port: 8888
[1678974517.990704] info | Root.cpp | set_verbose_level | logger setup | verbose_level: 4
[1678974531.335043] error | InputMessage.cpp | log_error | deserialization error | buffer:
0000: 7E 00 00 18 00 80 00 00 00
[1678974532.326210] error | InputMessage.cpp | log_error | deserialization error | buffer:
0000: 7E 00
```
What were my mistakes?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.