Giter Site home page Giter Site logo

eprosima / micro-xrce-dds-client Goto Github PK

View Code? Open in Web Editor NEW
129.0 16.0 76.0 6.31 MB

Micro XRCE-DDS Client repository. Looking for commercial support? Contact [email protected]

License: Apache License 2.0

CMake 9.27% C 71.51% C++ 15.11% Python 0.32% Shell 0.13% Dockerfile 0.14% CSS 3.22% HTML 0.31%
dds ros2 embedded c low-latency low-power embedded-systems dds-xrce middleware

micro-xrce-dds-client's Introduction

Micro XRCE-DDS Client

Releases License Issues Forks Stars Read the Docs Twitter Follow

Docker Build Status

eProsima Micro XRCE-DDS is a library implementing the DDS-XRCE protocol as defined and maintained by the OMG, whose aim is to allow resource constrained devices such as microcontrollers to communicate with the DDS world as any other DDS actor would do. It follows a client/server paradigm and is composed by two libraries, the Micro XRCE-DDS Client and the Micro XRCE-DDS Agent. The Micro XRCE-DDS Clients are lightweight entities meant to be compiled on eXtremely Resource Constrained Environments, while the Micro XRCE-DDS Agent is a broker which bridges the Clients with the DDS world.

General architecture

The Micro XRCE-DDS Clients request operations to the Agent to publish and/or subscribe to topics in the DDS global dataspace. Remote procedure calls, as defined by the DDS-RPC standard, are also supported, allowing Clients to communicate in the DDS dataspace according to a request/reply paradigm. The Agents process these requests and send back a response with the operation status result and with the requested data, in the case of subscribe/reply operations. The communication in the DDS world is mediated by a dedicated ProxyClient in charge of creating the DDS Entities requested by the Clients, such as Participants, Topics, Publishers, and Subscribers, which can interact with the DDS Global dataspace.

Client architecture

eProsima Micro XRCE-DDS provides the user with a C API to create Micro XRCE-DDS Clients applications. The library can be configured at compile-time via a set of CMake flags allowing to enable or disable some profiles before compilation, and to manipulate several parameters controlling some of the library's functionalities, which in turn allow tuning the library size.

The communication between a Micro XRCE-DDS Client and a Micro XRCE-DDS Agent is achieved by means of several kinds of built-in transports: UDPv4, UDPv6, TCPv4, TCPv6 and Serial communication. In addition, there is the possibility for the user to generate its own Custom transport.

Documentation

You can access the eProsima Micro XRCE-DDS user documentation online, which is hosted on Read the Docs.

Quality Declaration

eProsima Micro XRCE-DDS Client claims to be in the Quality Level 1 category based on the guidelines provided by ROS 2. See the Quality Declaration for more details.

Getting Help

If you need support you can reach us by mail at [email protected] or by phone at +34 91 804 34 48.

micro-xrce-dds-client's People

Contributors

acuadros95 avatar amfern avatar bjv-capra avatar bkueng avatar borjaouterelo avatar danielallstar avatar driftregion avatar franfin avatar gavanderhoorn avatar jamoralp avatar jseldent avatar julionce avatar kneep avatar lemunozm avatar mergify[bot] avatar pablogs9 avatar richiprosima avatar richiware avatar roncapat avatar srmainwaring avatar yszheda avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

micro-xrce-dds-client's Issues

compiling for new transport

Hi Pablo,
I think I am stuck with the compilation. I had run the command, ros2 run micro_ros_setup create_firmware_ws.sh freertos olimex-stm32-e407 of which created the firmware folder. For my case,

I make changes on some files in the folder firmware/mcu_ws/eProsima/Micro-XRCE-DDS-Client/PublishHellowWorld/main.c
, and added CAN_circular_buffer.c, CAN_circular_buffer.h.

Also, a file I changed in the folder Micro-XRCE-DDS-Client/src/c/profile/transport/ip/udp/udp_transport.c

I have not changed those variables in the CMakeList.txt relating to the static memory allocation yet. I will leave at a later stage when I have passed the compilation and debugging stages.

I followed almost to the completion of the step in https://micro-ros.github.io/docs/tutorials/core/create_new_type/, but I think I have got into a wrong pathway, as I am not creating a new message. I am creating a transport, but still using existing uxr_xxx_read()/write() functions, and using the main.c in the folder firmware/mcu_ws/eProsima/Micro-XRCE-DDS-Client/PublishHellowWorld.

I have also read the other issue with regards to compile errors. I was wondering that is applicable to me too, i.e., I should follow the instructions there, should I. I will give it a go while waiting for your answers.

Appreciate your advice, please.

Run session less then a millisecond

My needs require the session to run fast, less then 1 millisecond as to not inhibit latency to the rest of the system.
But the smallest time the client can run is 1ms because it uses uxr_millis() everywhere to measure timeout,
Is there a reason why it can't be in microseconds or nanoseconds?

deserialize eprosima::fastcdr::exception::NotEnoughMemoryException [5411]

Hi, @julianbermudez

<historyMemoryPolicy>PREALLOCATED_WITH_REALLOC</historyMemoryPolicy>

This method does not work.
There may be a problem with my XML expression. So, can you give an example of how to write XML for writers and readers on the client? (including details about datawriter)

Originally posted by @OpusK in #79 (comment)


And,
I tried the options below but it was useless.

<readerHistoryMemoryPolicy>PREALLOCATED_WITH_REALLOC</readerHistoryMemoryPolicy>
<writerHistoryMemoryPolicy>PREALLOCATED_WITH_REALLOC</writerHistoryMemoryPolicy>

Below is the error message.

deserialize eprosima::fastcdr::exception::NotEnoughMemoryException
Error processing WRITE_DATA submessage.
Error written data on DDS entity.

And below is the size of the data I am currently sending.
wireshark

Is it possible to publish/subscribe large data?

I'm trying to HelloWorld examples which connect to FastRTPS and publish/subscribe large data.
But client cannot publish/subscribe data.

Environment

OS: Ubuntu 16.04
Following examples execute in PC:

subscriber: FastRTPS example
HelloWorldExample  
      |  
micro RTPS agent  
      |  
publisher: micro RTPS client example  
PublishHelloWorld  

And I changed the micro-RTPS-client example.
Below is my code:

micro-RTPS-client/examples/PublishHelloWorld/main.c

114        topic.message = "AAAAA................."; // over 500 characters

Results

I captured network packets (wireshark) but client didn't send messages.

What am I doing wrong? configuration is wrong or memory problem?
Thanks for the help.

Big endianness problem [#4438]

1)When I run PublishHelloWorld demo,it will use uxr_run_session_time(connected = uxr_run_session_time(&session, 1000);).my client run on MCU(TMS570)
2)uxr_run_session_time
---uxr_output_streams_confirmed
---uxr_is_output_reliable_stream_busy (return 1)
---uxr_seq_num_cmp(stream->last_acknown, stream->last_sent) (return -1)
--- stream->last_acknown = 33023 , stream->last_sent=128

3)It only can pub 127 topic.The teturn of uxr_is_output_reliable_stream_busy is 1

  1. What's the problem?
    Can you give me some advice?

CAN-bus transport coding for micro-XRCE-Client and Agent

Hi Pablo,
It would be very appreciated you could share your opinions on where-about the code for CAN-bus transport should be placed.

  1. I will use the CAN-RX interrupt, and place them incoming bytes into a circular buffer for the uxr_xx_read() and uxr_xx_write() in udp_transport.c. As such, STM32CubeMX will be used to create the skeleton of the CAN-RX interrupt, and its, the interrupt body will fill up the circular buffer from which the uxr_xx_read() will be reading. For the same reason, the CAN-TX function will also reside in the stm32-e407 main(), and uxr_xxx_write() will call it, the CAN_Tx() when transmitting data. I think microROS which has the controller's low-level files, is needed. Does it make sense?

  2. I have read about CANSocket, which is a replica of Network Socket. With that I think I can change the body of UDPv4AgentLinux.cpp, i.e., bool UDPv4Agent::init(), bool UDPv4Agent::fini()
    bool UDPv4Agent::send_message(),
    bool UDPv4Agent::recv_message(). I would like to seek your opinion on that, please?

  3. BTW, can you please look into the read messages when I compiling in Raspberry Pi4? FYI, I did not specify it was Raspberry. I was wondering if that is the cause of the errors.

I look forward to hearing from you.

Thank you
V!

Compile error

~/env/Micro-XRCE-DDS-Client/build$ make

Scanning dependencies of target microcdr
[ 6%] Creating directories for 'microcdr'
[ 12%] Performing download step (git clone) for 'microcdr'
Cloning into 'microcdr'...
Note: checking out 'v1.2.0'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

git checkout -b

HEAD is now at 6c9a88f... Release v1.2.0 (#52)
[ 18%] No patch step for 'microcdr'
[ 25%] Performing update step for 'microcdr'
[ 31%] Performing configure step for 'microcdr'
loading initial cache file /home/pv/env/Micro-XRCE-DDS-Client/build/microcdr/tmp/microcdr-cache-.cmake
-- Setting build type to 'Release' as none was specified.
-- The C compiler identification is GNU 5.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- The CXX compiler identification is GNU 5.4.0
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/pv/env/Micro-XRCE-DDS-Client/build/microcdr/src/microcdr-build
[ 37%] Performing build step for 'microcdr'
Scanning dependencies of target ucdr
[ 12%] Creating directories for 'ucdr'
[ 25%] No download step for 'ucdr'
[ 37%] No patch step for 'ucdr'
[ 50%] No update step for 'ucdr'
[ 62%] Performing configure step for 'ucdr'
loading initial cache file /home/pv/env/Micro-XRCE-DDS-Client/build/microcdr/src/microcdr-build/ucdr-prefix/tmp/ucdr-cache-Release.cmake
-- Configuring done
-- Generating done
-- Build files have been written to: /home/pv/env/Micro-XRCE-DDS-Client/build/microcdr/src/microcdr-build
[ 75%] Performing build step for 'ucdr'
Scanning dependencies of target microcdr
[ 16%] Building C object CMakeFiles/microcdr.dir/src/c/common.c.o
[ 33%] Building C object CMakeFiles/microcdr.dir/src/c/types/basic.c.o
[ 50%] Building C object CMakeFiles/microcdr.dir/src/c/types/string.c.o
[ 66%] Building C object CMakeFiles/microcdr.dir/src/c/types/array.c.o
[ 83%] Building C object CMakeFiles/microcdr.dir/src/c/types/sequence.c.o
[100%] Linking C static library libmicrocdr.a
[100%] Built target microcdr
No install step for 'ucdr'
Completed 'ucdr'
Built target ucdr
[ 43%] Performing install step for 'microcdr'
[100%] Built target microcdr
Install the project...
-- Install configuration: "Release"
-- Installing: /home/pv/env/Micro-XRCE-DDS-Client/build/temp_install/microcdr-1.2.0/lib/libmicrocdr.a
-- Installing: /home/pv/env/Micro-XRCE-DDS-Client/build/temp_install/microcdr-1.2.0/include/ucdr
-- Installing: /home/pv/env/Micro-XRCE-DDS-Client/build/temp_install/microcdr-1.2.0/include/ucdr/microcdr.h
-- Installing: /home/pv/env/Micro-XRCE-DDS-Client/build/temp_install/microcdr-1.2.0/include/ucdr/visibility.h
-- Installing: /home/pv/env/Micro-XRCE-DDS-Client/build/temp_install/microcdr-1.2.0/include/ucdr/config.h
-- Installing: /home/pv/env/Micro-XRCE-DDS-Client/build/temp_install/microcdr-1.2.0/share/microcdr/cmake/microcdrTargets.cmake
-- Installing: /home/pv/env/Micro-XRCE-DDS-Client/build/temp_install/microcdr-1.2.0/share/microcdr/cmake/microcdrTargets-release.cmake
-- Installing: /home/pv/env/Micro-XRCE-DDS-Client/build/temp_install/microcdr-1.2.0/share/microcdr/cmake/microcdrConfig.cmake
-- Installing: /home/pv/env/Micro-XRCE-DDS-Client/build/temp_install/microcdr-1.2.0/share/microcdr/cmake/microcdrConfigVersion.cmake
[ 50%] Completed 'microcdr'
[ 50%] Built target microcdr
Scanning dependencies of target uclient
[ 56%] Creating directories for 'uclient'
[ 62%] No download step for 'uclient'
[ 68%] No patch step for 'uclient'
[ 75%] No update step for 'uclient'
[ 81%] Performing configure step for 'uclient'
loading initial cache file /home/pv/env/Micro-XRCE-DDS-Client/build/uclient-prefix/tmp/uclient-cache-.cmake
-- Setting build type to 'Release' as none was specified.
CMake Error at CMakeLists.txt:106 (find_package):
By not providing "Findmicrocdr.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "microcdr",
but CMake did not find one.

Could not find a package configuration file provided by "microcdr"
(requested version 1.2.0) with any of the following names:

microcdrConfig.cmake
microcdr-config.cmake

Add the installation prefix of "microcdr" to CMAKE_PREFIX_PATH or set
"microcdr_DIR" to a directory containing one of the above files. If
"microcdr" provides a separate development package or SDK, be sure it has
been installed.

-- Configuring incomplete, errors occurred!
See also "/home/pv/env/Micro-XRCE-DDS-Client/build/CMakeFiles/CMakeOutput.log".
CMakeFiles/uclient.dir/build.make:107: recipe for target 'uclient-prefix/src/uclient-stamp/uclient-configure' failed
make[2]: *** [uclient-prefix/src/uclient-stamp/uclient-configure] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/uclient.dir/all' failed
make[1]: *** [CMakeFiles/uclient.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

why client just receive first one message?

I send lots of messages from standard DDS publisher
such as:
Publisher matched
Message: go with index: 1 SENT
Message: go with index: 2 SENT
Message: go with index: 3 SENT
Message: go with index: 4 SENT
Message: go with index: 5 SENT
Message: go with index: 6 SENT
Message: go with index: 7 SENT
Message: go with index: 8 SENT
Message: go with index: 9 SENT
Message: go with index: 10 SENT

but when i try to subscrib it in client and just receive one

<== [Data | #0xFF00 | id: 0x0004 | from #0xFF00 | NONE | OK | FORMAT_DATA | size: 12]
on_hello_topic

Delete a specific entity resource.

Hi,

The client has an API to remove the session.
However, there is no API to delete each Entity.
I want to delete Entity only while maintaining Session.

Do you plan to add these APIs?

Is there a way to communicate an xrce client to ros2 ?

Scenario
I have an idl fil that goes as

struct Num {
	long num;
};

I had created an XRCE client that would connect with the agent to publish the above-mentioned topic.I was able to successfully connect with a DDS sub

Now I wanted to test this experiment with a ros2 node.
I connected the same XRCE client this time to XRCE agent and changed the topic name in accordance with this.Running ros2 node list and topic list have also successfully listed my node name and topic name.Now I had a ros2 node subscribing to the msg equivalent of the above idl file , that is:

int32 num

Now when I run the sub,the sub is not able to read the topic?Is there a solution to this problem.I am aware of micro ros and eProsima Integration Services ,but I am interested in finding a "native" solution to this problem , something that does not incorporate micro ros and integration services.

System Information

  1. Ubuntu 20.04
  2. XRCE Client v2.0(latest)
  3. ROS2 foxy

Thanks !

Best effort client not showing topics even though Agent is connected

Hi,

I am trying to get a client working on an embedded device without an OS, which has an agent running over linux.
When I use "reliable" QoS everything works as expected, however, when I try to use "best effort" I can't seem to find any topics. Even though the Agent shows logs as if the connection is alive.

Any modification required on the Agent side? Any elaborate examples for such a use case?

Any help is much appreciated,
Regards

No install target in v1.1.1 [5654]

When attempting to install the client, or when attempting to build the micro generator (which installs the client), I get a "No rule to make target `install'. Stop." This doesn't seem to be an issue with the previous v1.0.2 release that I was using.

Starting process 'Gradle Test Executor 4'. Working directory: /Micro-XRCE-DDS-Gen Command: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.212.b04-0.el7_6.x86_64/bin/java -Dbranch -Djava.security.manager=worker.org.gradle.process.internal.worker.child.BootstrapSecurityManager -Dorg.gradle.native=false -Dfile.encoding=US-ASCII -Duser.country=US -Duser.language=en -Duser.variant -ea -cp /root/.gradle/caches/4.10.2/workerMain/gradle-worker.jar worker.org.gradle.process.internal.worker.GradleWorkerMain 'Gradle Test Executor 4'
Successfully started process 'Gradle Test Executor 4'

com.eprosima.uxr.integration.MicroXRCEDDSGenIntegrationTest > runTests STANDARD_OUT
    Executing command: mkdir -p build/test/integration
    Executing command: rm -rf Micro-XRCE-DDS-Client
    Executing command: git clone -b master https://github.com/eProsima/Micro-XRCE-DDS-Client.git
    Executing command: mkdir build
    Executing command: cmake .. -DTHIRDPARTY=ON -DCMAKE_INSTALL_PREFIX=install
    Executing command: make install
    make: *** No rule to make target `install'.  Stop.

com.eprosima.uxr.integration.MicroXRCEDDSGenIntegrationTest > runTests SKIPPED

> Task :test FAILED
:test (Thread[Task worker for ':',5,main]) completed. Took 2.748 secs.

FAILURE: Build failed with an exception.

Problem with UCLIENT_PLATFORM_POSIX_NOPOLL flag

When UCLIENT_PLATFORM_POSIX_NOPOLL=ON, the following warning occours during compilation:

--- stderr: microxrcedds_client                                                                                  
/mnt/sdb/microros_ws/firmware/mcu_ws/eProsima/Micro-XRCE-DDS-Client/src/c/profile/transport/ip/ip_posix.c: In function 'uxr_ip_to_locator':
/mnt/sdb/microros_ws/firmware/mcu_ws/eProsima/Micro-XRCE-DDS-Client/src/c/profile/transport/ip/ip_posix.c:36:28: warning: implicit declaration of function 'inet_pton' [-Wimplicit-function-declaration]
             result = (1 == inet_pton(AF_INET, ip, locator->_.medium_locator.address));
                            ^~~~~~~~~
/mnt/sdb/microros_ws/firmware/mcu_ws/eProsima/Micro-XRCE-DDS-Client/src/c/profile/transport/ip/ip_posix.c: In function 'uxr_locator_to_ip':
/mnt/sdb/microros_ws/firmware/mcu_ws/eProsima/Micro-XRCE-DDS-Client/src/c/profile/transport/ip/ip_posix.c:62:31: warning: implicit declaration of function 'inet_ntop' [-Wimplicit-function-declaration]
             result = (NULL != inet_ntop(AF_INET, locator->_.medium_locator.address, ip, (socklen_t)size));
                               ^~~~~~~~~
/mnt/sdb/microros_ws/firmware/mcu_ws/eProsima/Micro-XRCE-DDS-Client/src/c/profile/transport/ip/ip_posix.c:62:28: warning: comparison between pointer and integer
             result = (NULL != inet_ntop(AF_INET, locator->_.medium_locator.address, ip, (socklen_t)size));
                            ^~
/mnt/sdb/microros_ws/firmware/mcu_ws/eProsima/Micro-XRCE-DDS-Client/src/c/profile/transport/ip/ip_posix.c:67:28: warning: comparison between pointer and integer
             result = (NULL != inet_ntop(AF_INET6, locator->_.large_locator.address, ip, (socklen_t)size));

See the following lines:

#if defined(UCLIENT_PLATFORM_POSIX)
#include <arpa/inet.h>
#elif defined(UCLIENT_PLATFORM_POSIX_NOPOLL)
#include <sys/socket.h>
#endif /* if defined(UCLIENT_PLATFORM_POSIX) */

I don't get why <arpa/inet.h> is not included for POSIX_NOPOLL platforms. inet_*to* family of functions is by standard declared there.

The fix is to include always <arpa/inet.h> for posix targets. Works for me (I'm trying to port microROS to RTEMS) and for now it seems that the UDP transport could be the easiest one to start with.

Discovery doesn't work

Environment:
MicroXRCEAgent: Raspberry Pi 4, Ubuntu 20.10
MicroXRCEClient: Discovery example on laptop, Ubuntu 20.04
Connection: Home wifi, the 2 devices could ping each other normally.
Issue: The discovery code built couldn't discover the Agent running on Raspberry Pi, the Discovery runs for some seconds without giving any outputs. The Agent side shows no connection established.

As far as I understand, the on_agent_found callback should be invoked and show the found agent and port. However, it doesn't seem to work. Please correct me if the understanding is wrong, thank you.

Large size topic transmission problem [4740].

Hi

We use Client and Agent in RaspberryPi to transfer the LIDAR data in TB3.

We have been using the LIDAR data of 360 degrees to 180 degrees so far as it is urgent.
But now I want to transfer all the data from the Client.

As a result of my testing, up to 240 data can be transferred without any problem. However, starting from 241, the following error occurs in Agent.

Error written data on DDS entity.

I did not calculate the exact size of the data, but when I send 240 data, it contains about 1000 bytes if I include the remaining data.

Let me know if you need more information.

How to use Micro-XRCE-DDS Client with FreeRTOS

Hello,

I don't know if this is the right place to ask. If it's not, where could I ask instead?

I'd like to use the Micro-XRCE-DDS Client Library on an Ambiq Apollo 3 MCU to communicate with a Raspberry Pi running ROS 2 foxy via UART. I have some experience with programming MCU's, but Real Time OS and using command line tools and makefiles or cmake to compile is completely new to me.

I managed to set up a working FreeRTOS Project with the Ambiq Apollo SDK but i don't know how to employ the Micro-XRCE-DDS Client Library. What would the appropriate workflow be like? Maybe someone could point me in the right direction :)

Should I be running micro-ros on the MCU? If so, why? I would prefer to keep the firmware simple.

Do I have to pre-compile the library? Or could I include the source files in my Makefile?

The example, which I found at https://github.com/eProsima/Micro-XRCE-DDS-Apps/tree/microxrce_dev/FreeRTOS, uses a FreeRTOS version, that implements the POSIX standard. Do I need this version of FreeRTOS?

How is the interface to the UART hardware handled? I expect ill have to implement some handling by myself, where should I do that?

Thanks for your help in advance!

Large topics aren't sent

Good morning,

following the steps in #7, I increased the MTU to 2048 Byte. Using micro-RTPS-gen, I created a Publisher and a Subscriber from some .idl-files. The size of my topic is 1032 byte
When running the Publisher, it doesn't seem to send anything to the agent. And the Subscriber doesn't receive anything. Wireshark tells me, that there are sent few UDP packages, which are way smaller than my topics (from 12 to 514 Byte), and then nothing more.
The very same code works for small topics. Is it possible that I have overseen some size restrictions aside from those in #7?
Any help is greatly appreciated (:

Zephyr transports

Please add Zephyr transports for Micro XRCE-DDS:

  • Zephyr USB-CDC Serial transport
  • Zephyr Serial UART transport
  • Zephyr networking transport

Hello DDS world subscriber always stop at 65535 [5039]

Hi dear,
I had setup the development environment according to MicroXRCE-DDS Documentation Release 1.0.0. I setup it in the Ubuntu 18.04 and compile the examples.

I ran the agent first, then ran the example programs, that is, the HellowWorld publisher and subscriber examples, in the same PC running Ubuntu.

However, after a day of running, subscriber will always stop with id = 65535. It seemed not publisher's problem since the publisher continues to send topic... and if I stop and restart the subscriber, the receiving will continue. I had verified this situation several times. Do you see similar situation? Please advise what possible is the problem. Thanks.

Copying ucdrBuffer in topic callback

Is it possible to allow the buffer ucdrBuffer passed as argumento to uxr_set_topic_callback callback to be copied without being deserialized?

session.c: 'time' shadows a global declaration

This is related to #252 (in that it's the same compiler/environment).

The time argument to uxr_sync_session(..) causes a compiler warning in my dev env about it shadowing a "global declaration". That global declaration appears to be time_t time(time_t *t):

bool uxr_sync_session(
uxrSession* session,
int time)

I'm not sure whether this warning would happen on other platforms as well -- it might be my compiler is too old to properly isolate things fi -- but the easiest fix to avoid the warning would be to rename the argument (the header provided by the SDK cannot be changed).

Would it be acceptable to rename the time argument to something else?

That argument is passed on to run_session_until_sync(..) which actually calls it timeout. It's not used anywhere else in uxr_sync_session(..).

Any plans to support the Arduino library?

Hi.

Are there plans to support the Arduino library for Micro-XRCE-DDS-Client?
Currently, it is cloned/modified by ros2arduino, but I thought it would be better if there was an officially managed library. (Simply not ros2 only)

Defaults value for CONFIG_MIN_SESSION_CONNECTION_INTERVAL is too low for reliable TCP stream

Hi,

I believe the default value for CONFIG_MIN_SESSION_CONNECTION_INTERVAL is too low.
By default, CONFIG_MIN_SESSION_CONNECTION_INTERVAL is 1 (ms) and CONFIG_MAX_SESSION_CONNECTION_ATTEMPTS is 12. This means that a XRCE client may try up to 12 times to create a session, with the maximum waiting period beginning from 1ms.

The sequence would be like this, assuming a successful transmission takes place and no response is received within the window:
1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048

If a message is received but is not a correct response, then it gets worse because the client will continue to wait for only 1ms.

However, depending on the speed of the client, the agent and the order of execution, the agent might get multiple CREATE SESSION messages from the client. This could be dangerous, if the agent successfully resets a reliable stream repeatedly, after at least one (reply) message has been sent. Resetting a reliable output stream after the session has been created, could result in a communications breakdown with no recovery, due to the sequence numbers going wrong.

The line in question is here:

                {
                    client->session().reset();
                }

If you add print statements/set a breakpoint before this line, it is possible to occasionally observe a session getting reset multiple times, for a client.

Across the Internet, it is possible for the RTT to be more than even 5ms. If TCP is used and Nagle is enabled, then the message could be delayed for up to 250ms, particularly if it is a small message.

In my opinion, I think increasing CONFIG_MIN_SESSION_CONNECTION_INTERVAL to a larger value like 500 could help reduce the odds of the agent receiving duplicate CREATE SESSION requests.
In exchange, CONFIG_MIN_SESSION_CONNECTION_INTERVAL could be reduced to 5, to prevent the timeout period from increasing to huge values.

Field has incomplete type with UDP transport

Hi,
I am trying to compile this library as part of micro-ros, but have run into an issue during the build process. The target board is armhf with some custom compiler configurations that I am not entirely aware of. I do also know it is older than the mainline version of GCC by at least 2 years.

Currently the build fails with the error

In file included from /home/coalman321/code/micro_ros_ws/firmware/mcu_ws/eProsima/Micro-XRCE-DDS-Client/include/uxr/client/transport.h:30:0,
                 from /home/coalman321/code/micro_ros_ws/firmware/mcu_ws/eProsima/Micro-XRCE-DDS-Client/include/uxr/client/util/ping.h:28,
                 from /home/coalman321/code/micro_ros_ws/firmware/mcu_ws/eProsima/Micro-XRCE-DDS-Client/src/c/util/ping.c:1:
/home/coalman321/code/micro_ros_ws/firmware/mcu_ws/eProsima/Micro-XRCE-DDS-Client/include/uxr/client/profile/transport/ip/udp/udp_transport.h:37:27: error: field 'platform' has incomplete type
     struct uxrUDPPlatform platform;
                           ^~~~~~~~
make[2]: *** [CMakeFiles/microxrcedds_client.dir/build.make:261: CMakeFiles/microxrcedds_client.dir/src/c/util/ping.c.obj] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from /home/coalman321/code/micro_ros_ws/firmware/mcu_ws/eProsima/Micro-XRCE-DDS-Client/src/c/profile/transport/ip/udp/udp_transport_internal.h:23:0,
                 from /home/coalman321/code/micro_ros_ws/firmware/mcu_ws/eProsima/Micro-XRCE-DDS-Client/src/c/profile/transport/ip/udp/udp_transport.c:2:
/home/coalman321/code/micro_ros_ws/firmware/mcu_ws/eProsima/Micro-XRCE-DDS-Client/include/uxr/client/profile/transport/ip/udp/udp_transport.h:37:27: error: field 'platform' has incomplete type
     struct uxrUDPPlatform platform;
                           ^~~~~~~~
/home/coalman321/code/micro_ros_ws/firmware/mcu_ws/eProsima/Micro-XRCE-DDS-Client/src/c/profile/transport/ip/udp/udp_transport.c: In function 'uxr_close_udp_transport':

Any help in fixing this would be greatly appreciated.

When subscriber use best effort stream, an error occurs.

I'm trying to HelloWorld examples which connect to FastRTPS.
I confirmed client can subscribe messages using reliable stream.
But when using best-effort stream, client is not working as desired.

I get this error:

UDP mode => ip: 127.0.0.1 - port: 2020 >>
Receive topic: HelloWorld, count: 1
Connection error at read_data

Environment

OS: Ubuntu 16.04
Following examples execute in PC:

publisher: FastRTPS example
HelloWorldExample  
      |  
micro RTPS agent  
      |  
subscriber: micro RTPS client example  
SubscribeHelloWorld  

And I changed the client's code to use the best-effort stream.
Below is my code:

examples/SubscribeHelloWorld/main.c

...(snipped)...
    /* Main loop */
    while(true)
    {
        /* Request data */
        read_data_sync(&my_session, datareader_id, STREAMID_BUILTIN_BEST_EFFORTS); // Changed here
        check_and_print_error(&my_session, "read_data");

        run_communication(&my_session);

        ms_sleep(100);
    }
...(snipped)...

Results

FastRTPS Puslisher send a lot of messages.
such as:

Starting 
Publisher matched
Message: HelloWorld with index: 1 SENT
Message: HelloWorld with index: 2 SENT
Message: HelloWorld with index: 3 SENT
Message: HelloWorld with index: 4 SENT
Message: HelloWorld with index: 5 SENT
Message: HelloWorld with index: 6 SENT
Message: HelloWorld with index: 7 SENT
Message: HelloWorld with index: 8 SENT
Message: HelloWorld with index: 9 SENT
Message: HelloWorld with index: 10 SENT

But client just receive one message and error occurs.
such as:

<< UDP mode => ip: 127.0.0.1 - port: 2020 >>
Receive topic: HelloWorld, count: 1
Connection error at read_data

What could be the cause of this error?

Appreciate your help.

Verbose build fails

These two build commands fails:

mkdir build; cd build; cmake .. -DUCLIENT_VERBOSE_SERIALIZATION=ON; make
mkdir build; cd build; cmake .. -DUCLIENT_VERBOSE_MESSAGE=ON; make

The error is:

/workspaces/Micro-XRCE-DDS-Client/src/c/core/log/log.c:20:10: fatal error: ../serialization/xrce_protocol_internal.h: No such file or directory
 #include "../serialization/xrce_protocol_internal.h"
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

Allow external TCP/UDP support for `udp_transport_datagram_internal`

Hello,
I'm building for a FreeRTOS-based platform using FreeRTOS-Plus-TCP. Its socket API lacks the functions and structs defined in linux's <sys/socket.h> .

My toolchain file contains:

set(CMAKE_SYSTEM_NAME Generic)

I'm able to make use of the sensible defaults for UDP and TCP defined in udp/tcp_transport_internal.h for the transport functionality. I'm compiling Micro-XRCE-DDS-Client as a static library. The implementations of the stubbed functions (using FreeRTOS-Plus-TCP) are inside my application code. All is well at link time.

I can't do the same thing for udp_transport_datagram_internal.h, because it defines uxrUDPTransportDatagram such that there's no means for extension

I propose something like this:

typedef struct uxrUDPTransportDatagram
{
    uint8_t buffer[UXR_UDP_TRANSPORT_MTU_DATAGRAM];
#if defined(UCLIENT_PLATFORM_POSIX)
    struct pollfd poll_fd;
#elif defined(UCLIENT_PLATFORM_WINDOWS)
    WSAPOLLFD poll_fd;
#else
    void *poll_fd;
#endif

About UXR_REUSE flag [4844].

Hi,

I am using UXR_REUSE or UXR_REPLACE flags when creating entities.

When creating the Topic, we use the following function parameters.

However, UXR_REUSE, as I expected, can not use the existing Topic Type, and the Agent is returning only the failure message as below.

2019-03-07 13:47:48.323 [PARTICIPANT Error] Type with the same name already exists:sensor_msgs::msg::dds_::BatteryState_ -> Function registerType
2019-03-07 13:47:48.830 [PARTICIPANT Error] Type with the same name already exists:sensor_msgs::msg::dds_::Joy_ -> Function registerType

Is not this flag implemented yet? Or is there something I'm using wrong?

Problem with discovery profile

Is it part of the specification that the client does not stop the discovery process until the discovery timeout is passed, even when an agent was already discovered?
For example, when the 'attempts' parameter is 1000(times) and the 'period' parameter is 1000(ms),
the client will try to discover an agent for 1000 seconds. Even when an agent is discovered, uxr_discovery_agents() does not return until 1000 seconds have passed.

In version 1.0.2, when an agent is discovered and a callback function returns true, variable 'consumed'  changes to true. And the client stops the discovery process.

while(0 < poll && !consumed)
{
consumed = listen_info_message(&transport, poll, &callback);
poll -= (int)(uxr_millis() - timestamp);
}

 
But since version 1.1.0, the client does not stop the discovery process until the discovery timeout is passed. Variable 'consumed' was deleted!
while(0 < poll)
{
(void) listen_info_message(&transport, poll, &callback);
poll -= (int)(uxr_millis() - timestamp);
}

Is this going to be fixed?

[1.0.1 Version] Related to XML and entity deletion.

Hi,

With the new release, the wiki introduces the following example to use XML.

uxrObjectId datareader_id = uxr_object_id(0x01, UXR_DATAREADER_ID);
const char* datareader_xml = "<dds>"
                                     "<data_reader>"
                                         "<topic>"
                                             "<kind>NO_KEY</kind>"
                                             "<name>HelloWorldTopic</name>"
                                             "<dataType>HelloWorld</dataType>"
                                         "</topic>"
                                     "</data_reader>"
                                 "</dds>";
uint16_t datareader_req = uxr_buffer_create_datareader_xml(&session, reliable_out, datareader_id, subscriber_id, datareader_xml, UXR_REPLACE);

In this case, however, neither the reader nor the writer (nor the participant) is created.
Rather, it works with older versions of XML styles like below. Is there something I'm using wrong?

"<profiles><subscriber profile_name=\"default_xrce_subscriber_profile\"><topic><kind>NO_KEY</kind><name>HelloWorldTopic</name><dataType>HelloWorld</dataType><historyQos><kind>KEEP_LAST</kind><depth>1</depth></historyQos><durability><kind>TRANSIENT_LOCAL</kind></durability></topic></subscriber></profiles>"

Next, there is issue related to entitiy deletion.
1.0.0 Beta2 is a feature I used well (used by XEL Network).
However, it does not work in newer versions. The code is used in the following manner. Has the usage changed?

uxrObjectId obj_id = {sub_list_[i]->reader_id_, UXR_DATAREADER_ID};
uxr_buffer_delete_entity(participant_.session, participant_.output_stream_id, obj_id);

long run stability issues

I'm trying to HelloWorld example which connect to agent by Serial.
Client is subscriber and use reliable stream.
It seems to be working fine but when running for a long time(over an hour), I got the following error.

Connection error at read_data

Environment

OS: Ubuntu 16.04
Following examples execute in PC(client and agent are executed in the same PC):

publisher: FastRTPS example
HelloWorldExample
      |  
micro RTPS agent
      | USB port: /dev/ttyUSB0
      |
      | Serial-to-USB Cable
      |
      | Serial port:/dev/ttyS0
subscriber: micro RTPS client example
SubscribeHelloWorld

And I changed the FastRTPS HelloWorldExample.
Below is my code:

Fast-RTPS/examples/C++/HelloWorldExample/HelloWorldPublisher.cpp

108         eClock::my_sleep(1000);   //  Modified: Publish at every 1 second

Fast-RTPS/examples/C++/HelloWorldExample/HelloWorld_main.cpp

57          mypub.run(10000);   // Modified: Run for a long time

Results

After about an hour, I got the following error.

such as:

...(snipped)...
Receive topic: HelloWorld, count: 4322
Connection error at read_data

What could be the cause of this problem?

Appreciate your help.

FreeRTOS+TCP zero copy - not possible to be used.

Hi,

I've been looking at the current implementation of the transport profile and it does not allow one to use the zero-copy feature from FreeRTOS+TCP.

These are examples from them
https://www.freertos.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/Networking_Tutorial_Zero_Copy_Receive.html
https://www.freertos.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/Networking_Tutorial_Zero_Copy_Send.html

You can see here and here that the flags are set to 0 on both cases.

I'd assume this requires some work on this implementation to provide the pre-allocated buffer.

Furthermore, as this implementation uses select, wouldn't it be better to simply enforce another flag FREERTOS_MSG_DONTWAIT, which does not iterate over recvfrom or sendto. I don't know if this would provide a significant improvement

Issue while compiling the client code

I have been following the steps listed in the tutorial about building the client code and I seem to run into the following error.

CMake Error at CMakeLists.txt:106 (find_package):
  By not providing "Findmicrocdr.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "microcdr",
  but CMake did not find one.

  Could not find a package configuration file provided by "microcdr"
  (requested version 1.2.0) with any of the following names:

    microcdrConfig.cmake
    microcdr-config.cmake

  Add the installation prefix of "microcdr" to CMAKE_PREFIX_PATH or set
  "microcdr_DIR" to a directory containing one of the above files.  If
  "microcdr" provides a separate development package or SDK, be sure it has
  been installed.


-- Configuring incomplete, errors occurred!
See also "/home/arsh/Micro-XRCE-DDS-Client/build/CMakeFiles/CMakeOutput.log".
Makefile:160: recipe for target 'cmake_check_build_system' failed
make: *** [cmake_check_build_system] Error 1

The error is exactly similar to the one that was asked here.
Even after following the intended work around I still seem to have the same problem.
It would be great if I could get some help here.

examples/Discovery/main.c:49:33: error: assignment to expression with array type agent_list[size].ip = argv[i]; [6559]

follow:https://micro-xrce-dds.readthedocs.io/en/latest/installation.html#installing-the-client-stand-alone

lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.3 LTS
Release: 18.04
Codename: bionic

apt-cache show ros-dashing-ros-base
Package: ros-dashing-ros-base
Version: 0.7.2-1bionic.20190923.212341
Architecture: amd64

edit: client.config file: Add:
PROFILE_CREATE_ENTITIES_XML=TRUE
PROFILE_READ_ACCESS=TRUE
PROFILE_WRITE_ACCESS=TRUE

cmake -DUCLIENT_BUILD_EXAMPLES=ON ..
make
it appears the error:
/home/yottayuan/Micro-XRCE-DDS-Client/examples/Discovery/main.c: In function ‘main’:
/home/yottayuan/Micro-XRCE-DDS-Client/examples/Discovery/main.c:49:33: error: assignment to expression with array type
agent_list[size].ip = argv[i];
^
examples/Discovery/CMakeFiles/Discovery.dir/build.make:62: recipe for target 'examples/Discovery/CMakeFiles/Discovery.dir/main.c.o' failed
make[2]: *** [examples/Discovery/CMakeFiles/Discovery.dir/main.c.o] Error 1
CMakeFiles/Makefile2:420: recipe for target 'examples/Discovery/CMakeFiles/Discovery.dir/all' failed
make[1]: *** [examples/Discovery/CMakeFiles/Discovery.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

Thanks.

Micro-XRCE-DDS on ESP8266 using PlatformIO + Arduino library

I'm trying to apply Micro-XRCE-DDS on a NodeMCU board with ESP8266 microprocessor.
The IDE is Visual Studio Code with PlatformIO plugin, Arduino is used for Wifi connection. Micro-XRCE-DDS library is also included. However, there are errors in udp_transport_posix.h at:
#include <sys/socket.h>
#include <poll.h>
It seems that the 2 libraries is are Linux only, not on arduinoespressif8266. Is there any customization or configuration that I can do to make it work on that specific board, please?

Issue cross-compiling for raspberry pi [4671]

I was trying to cross-compile the examples for raspberry pi using the following toolchain:

SET(CMAKE_SYSTEM_NAME Linux)
SET(CMAKE_SYSTEM_VERSION 1)
SET(CMAKE_C_COMPILER $ENV{HOME}/raspberrypi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc)
SET(CMAKE_CXX_COMPILER $ENV{HOME}/raspberrypi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++)
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

but I got the following error:

[ 64%] Building C object examples/PublishHelloWorld/CMakeFiles/PublishHelloWorldClient.dir/main.c.o
[ 66%] Building C object examples/PublishHelloWorld/CMakeFiles/PublishHelloWorldClient.dir/HelloWorld.c.o
[ 68%] Linking C executable PublishHelloWorldClient
../../libmicroxrcedds_client.a(time.c.o): In function `uxr_millis':
time.c:(.text+0x10): undefined reference to `clock_gettime'
collect2: error: ld returned 1 exit status
examples/PublishHelloWorld/CMakeFiles/PublishHelloWorldClient.dir/build.make:122: recipe for target 'examples/PublishHelloWorld/PublishHelloWorldClient' failed
make[2]: *** [examples/PublishHelloWorld/PublishHelloWorldClient] Error 1
CMakeFiles/Makefile2:178: recipe for target 'examples/PublishHelloWorld/CMakeFiles/PublishHelloWorldClient.dir/all' failed
make[1]: *** [examples/PublishHelloWorld/CMakeFiles/PublishHelloWorldClient.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

subscriber will crash when try to free topic

when we call

free(topic->m_message);
free(topic);

in void on_hello_topic(XRCEInfo info, const void* vtopic, void* args)

** Error in `./read': munmap_chunk(): invalid pointer: 0x00007f422282f260 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7f42222c47e5]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x1a8)[0x7f42222d1698]
./read[0x400ecf]
./read[0x407dbf]
./read[0x40f91b]
./read[0x40fc8b]
./read[0x408c4b]
./read[0x4010b6]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x76ba)[0x7f422261e6ba]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x6d)[0x7f422235441d]
======= Memory map: ========
00400000-00416000 r-xp 00000000 fc:00 29495744 /home/wma/eProsima/micro-RTPS/micro-RTPS-client/examples/quickhelloworld/read
00615000-00616000 r--p 00015000 fc:00 29495744 /home/wma/eProsima/micro-RTPS/micro-RTPS-client/examples/quickhelloworld/read
00616000-00617000 rw-p 00016000 fc:00 29495744 /home/wma/eProsima/micro-RTPS/micro-RTPS-client/examples/quickhelloworld/read
00617000-00618000 rw-p 00000000 00:00 0
0087e000-0089f000 rw-p 00000000 00:00 0 [heap]
7f421c000000-7f421c021000 rw-p 00000000 00:00 0
7f421c021000-7f4220000000 ---p 00000000 00:00 0
7f4221836000-7f422184c000 r-xp 00000000 fc:00 8393101 /lib/x86_64-linux-gnu/libgcc_s.so.1
7f422184c000-7f4221a4b000 ---p 00016000 fc:00 8393101 /lib/x86_64-linux-gnu/libgcc_s.so.1
7f4221a4b000-7f4221a4c000 rw-p 00015000 fc:00 8393101 /lib/x86_64-linux-gnu/libgcc_s.so.1
7f4221a4c000-7f4221a4d000 ---p 00000000 00:00 0
7f4221a4d000-7f422224d000 rw-p 00000000 00:00 0
7f422224d000-7f422240d000 r-xp 00000000 fc:00 8395368 /lib/x86_64-linux-gnu/libc-2.23.so
7f422240d000-7f422260d000 ---p 001c0000 fc:00 8395368 /lib/x86_64-linux-gnu/libc-2.23.so
7f422260d000-7f4222611000 r--p 001c0000 fc:00 8395368 /lib/x86_64-linux-gnu/libc-2.23.so
7f4222611000-7f4222613000 rw-p 001c4000 fc:00 8395368 /lib/x86_64-linux-gnu/libc-2.23.so
7f4222613000-7f4222617000 rw-p 00000000 00:00 0
7f4222617000-7f422262f000 r-xp 00000000 fc:00 8395367 /lib/x86_64-linux-gnu/libpthread-2.23.so
7f422262f000-7f422282e000 ---p 00018000 fc:00 8395367 /lib/x86_64-linux-gnu/libpthread-2.23.so
7f422282e000-7f422282f000 r--p 00017000 fc:00 8395367 /lib/x86_64-linux-gnu/libpthread-2.23.so
7f422282f000-7f4222830000 rw-p 00018000 fc:00 8395367 /lib/x86_64-linux-gnu/libpthread-2.23.so
7f4222830000-7f4222834000 rw-p 00000000 00:00 0
7f4222834000-7f4222838000 r-xp 00000000 fc:00 16646175 /usr/local/lib/libtransport.so
7f4222838000-7f4222a37000 ---p 00004000 fc:00 16646175 /usr/local/lib/libtransport.so
7f4222a37000-7f4222a38000 r--p 00003000 fc:00 16646175 /usr/local/lib/libtransport.so
7f4222a38000-7f4222a39000 rw-p 00004000 fc:00 16646175 /usr/local/lib/libtransport.so
7f4222a39000-7f4222a5f000 r-xp 00000000 fc:00 8395363 /lib/x86_64-linux-gnu/ld-2.23.so
7f4222c14000-7f4222c18000 rw-p 00000000 00:00 0
7f4222c5d000-7f4222c5e000 rw-p 00000000 00:00 0
7f4222c5e000-7f4222c5f000 r--p 00025000 fc:00 8395363 /lib/x86_64-linux-gnu/ld-2.23.so
7f4222c5f000-7f4222c60000 rw-p 00026000 fc:00 8395363 /lib/x86_64-linux-gnu/ld-2.23.so
7f4222c60000-7f4222c61000 rw-p 00000000 00:00 0
7ffd635e9000-7ffd6360b000 rw-p 00000000 00:00 0 [stack]
7ffd637f8000-7ffd637fb000 r--p 00000000 00:00 0 [vvar]
7ffd637fb000-7ffd637fd000 r-xp 00000000 00:00 0 [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
message----- Aborted (core dumped)

Allow user defined settings

Hi,

Currently, there is the following issue.

In particular, the definition mentioned in the link above is maintained in internal.h.

Users can find and fix these things one by one.
However, I thought that it would be nice if the user could define it all at once by a configuration file (eg. config.h)

What do you think about this?

Multithread includes wrong header FreeRTOS

I was trying to build the multithread header for FreeRTOS, adding add_definitions(PLATFORM_NAMES_FREERTOS) to my toolchain.
Then I got the compile error

Micro-XRCE-DDS-Client/include/uxr/client/profile/multithread/multithread.h:33:10: fatal error: freertos/FreeRTOS.h: No such file or directory
   33 | #include <freertos/FreeRTOS.h>

While in other files FreeRTOS is included as

#include "FreeRTOS.h"

I thought I had built the multithread feature, but I was clearly wrong. This needs to be fixed ASAP

About platform dependencies

Hello, all.

I am using microRTPS on FreeRTOS (with LwIP) and Non-OS.
This works well, but there are some things I want to improve.

First, in the case of Transport, it calls several UNIX header files (like "poll.h").
Therefore, in order to use it in other environments, I must also modify the header file.

In my opinion, this dependency header should be treated as a macro depending on the platform used.
Or, it would be nice to include these headers only in the c file, allowing the user to redefine the functions.
I can fork and modify your repository, but I would like to use it as much as possible without modification. (While c files have to be modified, I want to keep header files as is.)

And, do you have a plan to develop a library for Arduino?
Or do you have a plan to change the folder structure and header file including methods for Arduino's build environment?

Thanks :)

XRCE multithreading not supported for this platform - FreeRTOS - wrong flag

From micro-ROS/micro_ros_setup#312
I was trying to enable multithread support, however, I got

eProsima/Micro-XRCE-DDS-Client/src/c/profile/multithread/multithread.c:23:2: error: #error XRCE multithreading not supported for this platform.

By quickly skimming the code, it seems the wrong flag is used for FreeRTOS. I'm using FreeRTOS+TCP, on the base CMakeLists.txt, this sets UCLIENT_PLATFORM_FREERTOS_PLUS_TCP, on the other hand, https://github.com/eProsima/Micro-XRCE-DDS-Client/blob/foxy/src/c/profile/multithread/multithread.c#L13 expects to be PLATFORM_NAME_FREERTOS. As a workaround, I can set the flag on my colcon meta, but I think it's not the intended behavior.

Disabling IPv6 support

The platform I'm trying to build the client for does not offer support for IPv6.

While it doesn't appear there are many places where AF_INET6 et al. is referenced, I wanted to ask whether there is a way to disable looking for/using IPv6 at configure time (CMake option perhaps)?


Edit: I'm running into this as I'm trying to build the posix set of UDP/TCP transports. I could create a custom transport and make it "IPv6-less", but I'm hoping there would be a more efficient way of achieving this.

can't see topic with the ros2 topic list command

Hi.
I'm using the PublishHelloWorld sample code.
I have a problem getting topic list.

Environment
Ubuntu 18.04.4 LTS
Micro-XRCE-DDS-Agent v1.4.0
Micro-XRCE-DDS-Client v1.2.3
ROS Dashing Patch6

Problem

➜  ~ ros2 node list
/default_xrce_participant

➜  ~ ros2 topic list
/parameter_events
/rosout

Do you have any idea on how to solve this problem?

Thank you.

How to use best-effort stream to receive data?

Hi, I want to test the latency between a Micro-DDS-Client and a global FAST-DDS node and meet a problem.
My way to estimate the latency is to caculate the roundtrip.

If I use reliable stream, it seems to be working well, and related parts of my code:

   ......
    uint8_t output_reliable_stream_buffer[2048];    
    uint8_t input_reliable_stream_buffer[2048];   
    uxrStreamId reliable_out = uxr_create_output_reliable_stream(&session, output_reliable_stream_buffer, 2048, 4);
    uxrStreamId reliable_in =  uxr_create_input_reliable_stream(&session, input_reliable_stream_buffer, 2048, 4);         
/* then I create participant, publisher, subscriber, datawriter, datareader in omitted section below */
    ......
/* request data  */
    uxrDeliverControl delivery_control = {0};
    devery_control.max_samples = UXR_MAX_SAMPLES_UNLIMITED;
    uint16_t read_data_req = uxr_buffer_request_data(&session, reliable_out, datareader_id, reliable_in, &delivery_control);
    uint8_t status[1];
    uint8_t requests[1];
/*  in test loop */
    ......
    uxr_parepare_output_stream(&session, reliable_out, datawriter_id, &ub, topic_size);
    HelloWorld_serialize_topic(&ub, &topic);
    start_time = xtimer_now_usec();
    uxr_run_session_until_all_status(&session, 1000, requests, status, 1);
    ......

With the code above, the global Fast-DDS node running on the same host as Micro-XRCE-DDS-Agent can receive the msg from the Micro-XRCE-DDS-Client, and the global Fast-DDS node will pub the message to another topic, and the DDS-Client will receive the msg and calculate the roundtrip time.

The problem is:
The roundtrip time caculated by the code above is about 3ms, and is not stable, sometimes 10ms.
I think the latency is a little long (ping time for same data size is about 1.5ms), so I decide to try best-effort stream.
I modified the code above:

    ......
    uint8_t output_best_effort_stream_buffer[2048];    
    uxrStreamId best_effort_out = uxr_create_output_best_effort_stream(&session, output_reliable_stream_buffer, 2048);
    uxrStreamId best_effort_in =  uxr_create_input_best_effort_stream(&session);         
/* then I create participant, publisher, subscriber, datawriter, datareader in omitted section below */
    ......
/* request data  */
    uxrDeliverControl delivery_control = {0};
    devery_control.max_samples = UXR_MAX_SAMPLES_UNLIMITED;
    uint16_t read_data_req = uxr_buffer_request_data(&session, best_effort_out, datareader_id, best_effort_in, &delivery_control);
/*  in test loop */
    ......
    uxr_parepare_output_stream(&session, best_effort_out, datawriter_id, &ub, topic_size);
    HelloWorld_serialize_topic(&ub, &topic);
    start_time = xtimer_now_usec();
    uxr_flash_output_streams(&session);
    ......

I can send data to global Fast-DDS node, but there seems to be no API for accepting data when using best-effort stream.
If I use uxr_run_session_until_all_status() or uxr_run_session_until_timeout() to receive data, it will cause error.

So I have two questions:

  1. If I use best-effort stream to send and receive data, will round-trip time be reduced?
  2. How to accept data when using best-effort stream?

Does TimeSync example work correctly?

When I ran the TimeSync example, I found the result like this:
synchronized with time offset 11187us
synchronized with time offset 411497us
sychronized with time offset 22794us
sychronized with time offset 471705us
...
I ran an Micro-XRCE-DDS-agent on an computer and a client on another computer, both of them were on the same LAN.
(I made some change in CMakelists and main.c of TimeSync to let it build and compile)
Why does time offset keep changing? Shouldn't the two computers have fixed time offset?

About creating participant using xml string.

Hi,

In the current version I know that I can only create participant through mr_write_create_participant_ref().
Will you also support REPRESENTATION_AS_XML_STRING method?
And Agent only supports "default participant" for REPRESENTATION_BY_REFERENCE method.
Will you support other strings later?

How to add transport descriptor in xml when create a participant

When I create a participant using xur_buffer_create_participant_xml
and my participant_xml is
const char* participant =

                                               "<dds>"  
                                                "<transport_descriptors>" 
                                                    "<transport_descriptor>" 
                                                          "<transport_id>"udp</transport_id>"
                                                          "<type>UDPv4</type>"
                                                   "</transport_descriptor>"
                                                "<transport_descriptors>"
                                                "<participant>"
                                                    "<domainId>231</domainId>"
                                                 "<rtps>"
                                                       "<name>default_xrce_participant</name>"
                                                       "<useBuiltinTransports>false</useBuiltinTransports>"
                                                        "<userTransports>"
                                                              "<transport_id>"udp</transport_id>"
                                                        "</userTransports>"
                                                   "</rtps>"     
                                                  "</participant>"
                                                 "</dds>"   

and then use
uint16_t participant_req = uxr_buffer_create_participant_xml(&session, best_effort_out, participant_id, 0, participant_xml, UXR_REPLACE);
to buffer the string,
But after I send this to the agent, the xrce-agent doesn't seem to able to parse this string, and it returns the following error
[XMLPARSER Error] Not expected tags: 'transport_descriptors' -> Function parse XML

So how to add transport descriptor when create a participant in XRCE-DDS?

Compile Error [5607]

Hi,

A compilation error occurs in log.c.
If I exclude log.c from the compilation there is no problem, but anyway, I tell you that client has this problem.

D:\source\arduino_sketchbook\libraries\ros2arduino\src\ros2\xrcedds\micro_xrce_dds\lib\src\c\core\log\log.c: In function 'print_create_client_submessage':

D:\source\arduino_sketchbook\libraries\ros2arduino\src\ros2\xrcedds\micro_xrce_dds\lib\src\c\core\log\log.c:380:39: error: 'CREATE_CLIENT_Payload {aka const struct CREATE_CLIENT_Payload}' has no member named 'base'

             request_to_string(&payload->base),

                                       ^

D:\source\arduino_sketchbook\libraries\ros2arduino\src\ros2\xrcedds\micro_xrce_dds\lib\src\c\core\log\log.c: In function 'print_status_agent_submessage':

D:\source\arduino_sketchbook\libraries\ros2arduino\src\ros2\xrcedds\micro_xrce_dds\lib\src\c\core\log\log.c:486:37: error: 'STATUS_AGENT_Payload {aka const struct STATUS_AGENT_Payload}' has no member named 'base'

             reply_to_string(&payload->base),

                                     ^

D:\source\arduino_sketchbook\libraries\ros2arduino\src\ros2\xrcedds\micro_xrce_dds\lib\src\c\core\log\log.c: In function 'print_read_data_submessage':

D:\source\arduino_sketchbook\libraries\ros2arduino\src\ros2\xrcedds\micro_xrce_dds\lib\src\c\core\log\log.c:539:40: error: 'ReadSpecification {aka const struct ReadSpecification}' has no member named 'input_stream_id'

             payload->read_specification.input_stream_id,

                                        ^

Actually, the member does not exist as shown below.

struct ReadSpecification

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.