ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Debug logging of micro-ROS on Android

asked 2022-05-06 04:31:58 -0600

kvik gravatar image

updated 2022-05-06 04:34:18 -0600

I have an application for Android written in C++ which I want to connect with the ROS 2 world using micro-ROS, which is said to support Android out of the box. I had many issues using the standard 'android generic' configuration so in the end I created a custom Android configuration for a 'generate_lib' build and linked the resulting library archive to the usual Gradle + CMake build. This works quite nicely as far as building is concerned.

However, I have problems running the simple string publisher code. The program fails right at the beginning during initialization inside rclc_support_init call (I manually traced it a bit further down to rmw_init inside rcl_init). Unfortunately, I could get no indication as to what exactly is failing due to logging being apparently disabled by default for rcl, at least in this build. I tried, to no avail, to enable it by doing the following:

  • defined RCL_LOGGING_ENABLED=ON for rcl in colcon.meta,
  • included spdlog_vendor inside mcu_ws workspace

This seems to build the logging infrastructure but I still get no logging output.

What else do I need to do to get the logging output from rcl?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-05-09 01:25:57 -0600

Pablogs gravatar image

updated 2022-05-09 01:26:10 -0600

Hello @kvik, where is it said that Android is supported out of the box?

Where are you running the micro-ROS Agent?

Could you please open an issue in the Github repo you are using in order to allow us to track this issue?

edit flag offensive delete link more

Comments

Android is listed in the "Supported platforms" table in the micro_ros_setup README. It does say, in footnote, that it's only community supported but at the time I didn't let that comment detract from my optimism.

In any case, I did manage to debug the issue and had successfully connected to ROS 2 world from Android using micro-ROS. The issue turned out to be a couple of fairly stupid things combined: firstly, I forgot to add the INTERNET permission to my Android app, secondly I was trying to connect to the agent while on a different Wi-Fi network. Both of these would have become immediately obvious have I managed to turn on the logging somehow -- which, btw, I still haven't figured out.

When I find a bit of time I will be submitting my generate_lib config for Android and I'll try to figure out how the android ...(more)

kvik gravatar image kvik  ( 2022-05-10 12:37:11 -0600 )edit

Nice thanks!

Pablogs gravatar image Pablogs  ( 2022-05-11 07:23:50 -0600 )edit

Question Tools

3 followers

Stats

Asked: 2022-05-06 04:31:58 -0600

Seen: 571 times

Last updated: May 09 '22