Skip to content

How to get an error message when rcl_ret_t is 1? #1880

Open
@JamesTann

Description

@JamesTann

How to get an error message when rcl_ret_t is 1?

  • Hardware: Arduino Portenta
  • Version: humble

Note: This is not an issue, just a question, so my apologies if this is not the right place to ask it.

I modeled this macro after the RCCHECK one used throughout the examples:

#define RCCHECK(fn)              \
  {                              \
    rcl_ret_t temp_rc = fn;      \
    if ((temp_rc != RCL_RET_OK)) \
    {                            \
      ros_error(temp_rc);        \
    }                            \
  }

Which calls this function:

void ros_error(const int temp_rc)
{
  Serial.println("Error code encountered from ROS: " + String(temp_rc));
  Serial.println(rcl_get_error_string().str);
  rcutils_reset_error();
  NVIC_SystemReset();
}

However, when I encounter an error, I see this garbled output:

Output:
image

What is the proper way of getting a more specific error message?

Note: I am communicating to the Micro ROS Agent using ethernet, so my understanding is that I can safely using serial for debugging

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions