micro-ROS / micro-ROS/micro_ros_arduino

Publisher basic example does not work in Teensy 4.1 after receiving a new docker image micro_ros_static_library_builder Pull

Open
#1,503 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
576
Forks
146
PR merge metrics
No merged PRs in 30d

Description

## Issue template

- Hardware description: Teensy4.1
- RTOS: No
- Installation type: Arduino IDE (Version : 2.1.0)
- Version or commit hash: humble

#### Steps to reproduce the issue

(1) code behavior
* Create 1 Publisher and 1 Timer on 1 node to publish ros message
* Using examples from micro_ros_arduino/examples/micro-ros_publisher

```
#include

#include
#include
#include
#include
#include

#include

rcl_publisher_t publisher;
std_msgs__msg__Int32 msg;
rclc_executor_t executor;
rclc_support_t support;
rcl_allocator_t allocator;
rcl_node_t node;
rcl_timer_t timer;

#define LED_PIN 13

#define RCCHECK(fn) { rcl_ret_t temp_rc = fn; if((temp_rc != RCL_RET_OK)){error_loop();}}
#define RCSOFTCHECK(fn) { rcl_ret_t temp_rc = fn; if((temp_rc != RCL_RET_OK)){}}

void error_loop(){
while(1){
digitalWrite(LED_PIN, !digitalRead(LED_PIN));
delay(100);
}
}

void timer_callback(rcl_timer_t * timer, int64_t last_call_time)
{
RCLC_UNUSED(last_call_time);
if (timer != NULL) {
RCSOFTCHECK(rcl_publish(&publisher, &msg, NULL));
msg.data++;
}
}

void setup() {
set_microros_transports();

pinMode(LED_PIN, OUTPUT);
digitalWrite(LED_PIN, HIGH);

delay(2000);

allocator = rcl_get_default_allocator();

//create init_options
RCCHECK(rclc_support_init(&support, 0, NULL, &allocator));

// create node
RCCHECK(rclc_node_init_default(&node, "micro_ros_arduino_node", "", &support));

// create publisher
RCCHECK(rclc_publisher_init_default(
&publisher,
&node,
ROSIDL_GET_MSG_TYPE_SUPPORT(std_msgs, msg, Int32),
"micro_ros_arduino_node_publisher"));

// create timer,
const unsigned int timer_timeout = 1000;
RCCHECK(rclc_timer_init_default(
&timer,
&support,
RCL_MS_TO_NS(timer_timeout),
timer_callback));

// create executor
RCCHECK(rclc_executor_init(&executor, &support.context, 1, &allocator));
RCCHECK(rclc_executor_add_timer(&executor, &timer));

msg.data = 0;
}

void loop() {
delay(100);
RCSOFTCHECK(rclc_executor_spin_so
```

#### Expected behavior
* 1 timer publishes a ROS message every second.

#### Actual behavior
* Confirm that 1 publisher is created.
* The message is not published.

#### Additional information
* The operating system of the Arduino IDE is Windows 10.

* In WSL, the precompiled library was built by referring to the following address.
**- Reference address 1 : https://github.com/micro-ROS/micro_ros_arduino**
**- Reference address 2 : https://hub.docker.com/r/microros/micro_ros_static_library_builder**

* After updating the microros/micro_ros_static_library_builder Docker image using the Docker Pull command around 23.08.17, the code does not work.

* The existing image was used around 23.06.29 using the Docker Pull command.

* Question: Are there any changes to microros/micro_ros_static_library_builder Docker between 23.06.29 and 23.08.17? Also, is there any cause of the problem that you know about this issue?

Contributor guide

Open the contributing guide

Research direction

Start with the micro_ros_arduino/examples/micro-ros_publisher example and reproduce the missing publication on Teensy 4.1 using the 23.08.17 Docker image. Compare the generated library and behavior with the 23.06.29 image, using the Arduino IDE and WSL setup described. Done means identifying the image change or cause and documenting a reproducible resolution.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, docker
Domain
embedded-iot
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.