Closed andrew-cra2019 closed 1 year ago
You need to increase the max number of services on the default meta file: detail.
You can create your own .meta
file with this value increased, check the Readme section Other configuration for the steps.
Hi @Acuadros95 , Thanks for getting abck so quickly.
I have changed the colcon.meta and then again executed "pio run" before uploading to target. But the problem still persists.
Here is the colcon.meta
{
"names": {
"rmw_microxrcedds": {
"cmake-args": [
"-DRMW_UXRCE_MAX_NODES=1",
"-DRMW_UXRCE_MAX_PUBLISHERS=10",
"-DRMW_UXRCE_MAX_SUBSCRIPTIONS=5",
"-DRMW_UXRCE_MAX_SERVICES=2",
"-DRMW_UXRCE_MAX_CLIENTS=1",
"-DRMW_UXRCE_MAX_HISTORY=4",
"-DRMW_UXRCE_TRANSPORT=custom"
]
}
}
}
Anything else I'm missing? Thank you so much!
Just noted the comment:
Note: the [common.meta](https://github.com/micro-ROS/micro_ros_platformio/blob/main/metas/common.meta) file makes general adjustments to the library and shall not be modified by the user.
I will try following the documentation. Reporting back shortly
Updated my platformio.ini to the below:
[env:teensy41]
platform = teensy
board = teensy41
framework = arduino
board_microros_transport = serial
monitor_port = /dev/ttyUSB0
board_microros_distro = humble
board_microros_user_meta = custom.meta
lib_deps =
https://github.com/micro-ROS/micro_ros_platformio
And then I added a new file under the main project directory named accordingly: "custom.meta" with the following content:
{
"names": {
"rmw_microxrcedds": {
"cmake-args": [
"-DRMW_UXRCE_MAX_NODES=1",
"-DRMW_UXRCE_MAX_PUBLISHERS=10",
"-DRMW_UXRCE_MAX_SUBSCRIPTIONS=5",
"-DRMW_UXRCE_MAX_SERVICES=2",
"-DRMW_UXRCE_MAX_CLIENTS=1",
"-DRMW_UXRCE_MAX_HISTORY=4",
"-DRMW_UXRCE_TRANSPORT=custom"
]
}
}
}
After that, I removed the .pio folder in case my previous fiddling in the .meta file has caused some unwanted changes in the lib. did a clean and the followed the proper build steps:
And it worked, all services, subscriber and publisher are actually running together :-)
You're fantastic help with my project. I do so truly appreciate your help with this, mate!
I will create another example from this and promise to create a pull-request to main, as soon as my other pending PR is accepted. Just for the reason, I don't know how to amend to an existing PR :-)
Thank you so very much @Acuadros95
Steps to reproduce the issue
Expected behavior Compile without error and actually work on target, creating two individual services under single node
Actual behavior Compiles just fine, but once loaded into target, the initialization of second service (setBool) will cause the error_loop to be called. This is in line
RCCHECK(rclc_service_init_default(&service_setBool, &node, ROSIDL_GET_SRV_TYPE_SUPPORT(example_interfaces, srv, SetBool), "/setbool"));
Additional Information Each service works by itself. Removing (commenting) one or the other results in proper function. There must be something wrong with the RCCHECK? Tracking it back, it returns error code
RCL_RET_OK
I found the definition in file types.h:
Hovering with the mouse over the individual #defines, the tooltip revealed the "1" seen in my debug output resolves to
RMW_RET_ERROR
with the comment above:
/// Unspecified error return code.
platfomio.ini
Source code