-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
QoS / middleware configuration: modifying buffer stream size #23
Comments
Hello @anaelle-sw, some points:
// Init
std_msgs__msg__String msg;
msg.data.data = (char*)malloc(200*sizeof(char));
msg.data.size = 0;
msg.data.capacity = 200;
// Use
char my_str[] = "TEST";
memcpy(msg.data.data, my_str, strlen(my_str));
msg.data.size = strlen(msg.data.data);
rcl_publish(&publisher, &msg, NULL); Please let me know how do you initialize your string and if this approach works for you.
I think that is important to clarify the usage of
|
About the string initialization, I am using a char list, just like this one:
Then I was just putting the right
This worked well, but only for Thanks for the explanations and documentations! I have checked out these, and we will sure find them to be really useful very soon. So, I will close this issue for now. Thanks for your awesome support! |
Sorry to re-open this, but I have one more question. Our complete application that we need to run on our Teensy board features:
When having the middleware configuration set to default (except for I have read this (really nice!) document about memory profiling for micro-ROS. So I understand that the memory for subscribers/publishers/services/clients is pre-allocated, and defined at build time by the parameters set in the My questionings here are about the reserved memory for subscribers/services/clients. If you use Thanks! |
Hello @anaelle-sw, if you use Regarding the memory pools optimizations, we are planning it, maybe in a couple of weeks, we have some results. Of course, it will apply also for micro-ROS for Arduino. Now your problem, I think that I can help you to tune your configuration in order to fit in reasonable memory usage. Can you detail more information about these entities? I would need to know you if they are best_effort or you need reliability. And the most important thing: how big are your topics? Knowing these two things we can tune |
Really nice! Thanks for helping! So these are the entities I need:
I hope I didn't do huge mistakes computing these. I considered strings to be max. 100 bytes sized. Best effort is fine for all. |
Try to set This way you will have RMW buffer of 512 B for each sub, service and client. Publishers does not have RMW buffers. With the default configuration, you have 2048 B buffer in RMW for each sub, service and client entity. I'm leaving for today, but if this does not work on Monday I will reproduce your use case and try fit the memory requirements here. |
Your idea seems great, but some problems occurred... Setting Then I tried What does the "D" in front of the other options stands for?( "Default", may be?) Why does it make the application crash? I guess the issue is coming from my
As you can see, it is similar to the default file, except I set up the options Thanks for helping out on this! Have a nice week-end |
Hello @anaelle-sw, I forgot to mention something. When using XML you have to ensure that the XML strings that the micro-ROS client sends to the agent in order to create the entities fit in the buffer. These XML strings are generated for example here. So the point is that with MTU = 128 B and XRCE history = 4 some of these XML doesn't fit in the buffer. We have a couple of options:
|
Hi! I tried to double the buffer size by setting Using refs is not really a good fit for us, at least for now. I will maybe test this for optimization later on, but now we would like to make our application run without needing to configure each entity, as some clients/servers might be changed in the next weeks/months. After discussing with colleagues, we think it might be better to slightly re-design our application and reduce the number of services, while keeping the default middleware configuration. This way, we prevent to have memory usage conflicts between what we optimized for our application, and what the micro-ros lib requires. I will let you know if I still encounter memory usage issues even with a reduction of entities. By the way, we are still looking forward to be able to use the history pool optimization you are working on. Thanks for support! |
Hello @anaelle-sw, investigating this we have found a couple of bugs. I'm going to update the library this afternoon. I'll notify you here in a while. |
Ok, we have merged micro-ROS/rmw_microxrcedds#84 and eProsima/Micro-XRCE-DDS-Client#167. I just have updated this library to v0.0.3 and I have tested the publisher example with the following {
"names": {
"tracetools": {
"cmake-args": [
"-DTRACETOOLS_DISABLED=ON",
"-DTRACETOOLS_STATUS_CHECKING_TOOL=OFF"
]
},
"rosidl_typesupport": {
"cmake-args": [
"-DROSIDL_TYPESUPPORT_SINGLE_TYPESUPPORT=ON"
]
},
"rcl": {
"cmake-args": [
"-DBUILD_TESTING=OFF",
"-DRCL_COMMAND_LINE_ENABLED=OFF",
"-DRCL_LOGGING_ENABLED=OFF"
]
},
"rcutils": {
"cmake-args": [
"-DENABLE_TESTING=OFF",
"-DRCUTILS_NO_FILESYSTEM=ON",
"-DRCUTILS_NO_THREAD_SUPPORT=ON",
"-DRCUTILS_NO_64_ATOMIC=ON",
"-DRCUTILS_AVOID_DYNAMIC_ALLOCATION=ON"
]
},
"microxrcedds_client": {
"cmake-args": [
"-DUCLIENT_PIC=OFF",
"-DUCLIENT_PROFILE_UDP=OFF",
"-DUCLIENT_PROFILE_DISCOVERY=OFF",
"-DUCLIENT_PROFILE_SERIAL=ON",
"-DUCLIENT_EXTERNAL_SERIAL=ON",
"-DUCLIENT_SERIAL_TRANSPORT_MTU=128"
]
},
"rmw_microxrcedds": {
"cmake-args": [
"-DRMW_UXRCE_MAX_NODES=1",
"-DRMW_UXRCE_MAX_PUBLISHERS=21",
"-DRMW_UXRCE_MAX_SUBSCRIPTIONS=3",
"-DRMW_UXRCE_MAX_SERVICES=12",
"-DRMW_UXRCE_MAX_CLIENTS=3",
"-DRMW_UXRCE_MAX_HISTORY=1",
"-DRMW_UXRCE_STREAM_HISTORY=5",
"-DRMW_UXRCE_TRANSPORT=custom_serial"
]
}
}
} Before testing it with your code, could you tell me if the example with this meta works for you? PD: I also have updated the library generation Docker, do a |
The example publisher works nicely for me with this config and the new release, as well as our complete application! It allow us to keep our application as it is, while having 53% memory usage: it is perfect for us! I will close this. Thanks a lot! |
I also faced to docker pull microros/micro-ros-agent:$ROS_DISTRO My environment |
Hi! I am trying to configure a publisher's QoS policy by modifying the
colcon.meta
file of micro_ros_arduino library. I rather not use labels and.refs
files for now.Setup
Use case description
I got one
std_msgs__msg__Range
type publisher running on my Teensy board. I can perfectly get the published messages viaros2 topic echo /my/range/topic
, if the messages'frame_id
is less than 6 char long. If not, the following error raises when checking out the topic:As I got nine different frames ID which should be strings between 19 and 23 char long, I need to increase the stream buffer size. To do so, I tried to follow the micro-ROS tutorials about middleware configuration
Steps to reproduce
As I use a Teensy 3.1 board, the file which should be modified is
colcon_lowmem.meta
. After any modification of this file, I build the micro_ros_arduino library (only for Teensy 3 type boards) with command lines:cd /Arduino/libraries/micro_ros_arduino
sudo docker pull microros/micro_ros_arduino_builder:latest
sudo docker run -it --rm -v $(pwd):/arduino_project microros/micro_ros_arduino_builder:latest -p teensy3
UCLIENT_SERIAL_TRANSPORT_MTU
, which is set at12
by default, according to the micro-ROS tutorial. So, I modified thecolcon_lowmem.meta
file to get this:Once the library is built, I am able to upload the .ino source file on the board. But the application seems "stuck" right after initialization, as when running the micro-ROS agent, the only output is:
... and then stops.
I got the same result when trying to set this option to its default value:
"-DUCLIENT_SERIAL_TRANSPORT_MTU=12"
.So I guess this is not the right way to set up this option.
"RMW_UXRCE_STREAM_HISTORY"
instead:I tried with different values between 5 and 20.
With this option set up at 5 (which I guess is the default value), I get the same results as before configuring: the buffer stream error is raised.
With any else tested values (example: 20), I cannot upload my .ino code to the board.
Questions
Using custom QoS with
.refs
files and labels requires to define QoS for every publisher/subscriber that you declare, right? If so, I would really rather configure the QoS without using labels. So, I need to modify mycolcon.meta
file. Did I miss something about this? It seems that if I modify anything in this file, my application stops working.Do you have any documentation or example
colcon.meta
file I could base mine on? It seems to me that micro-ROS tutorial does not list all settings (with definition, boundaries, etc, for each) for QoS/middleware configuration, and I was not able to find more exhaustive (and relevant) documentation about it.Thank you for your awesome micro_ros_arduino and support!
The text was updated successfully, but these errors were encountered: