Closed Pansamic closed 9 months ago
Which is the output of the XRCE Agent with the -v6
flag?
Nothing.
That means that your board is not sending anything via UART port. Could you debug that?
Agent didn't respond to this client.
I use cutecom
to monitor UART output and get Sequence-1 when program runs to uxr_init_session(&session, &transport.comm, 0xAAAABBBB)
Sequence-1 generated by uxr_init_session(&session, &transport.comm, 0xAAAABBBB)
// Sequence-1
80 00 00 00 00 01 10 00 58 52 43 45 01 00 01 0f aa aa bb bb 81 00 fc 03
The agent did not receive anything as you can see in your image. Are you choosing the right serial device and baudrate?
Yes, I've checked serial device and baudrate (default is 115200) countless times.
Sequence-2 is the client output of rmw_uros_ping_agent(100,1)
of a Micro-ROS project.
// Sequence-2
7e 00 00 10 00 80 00 00 00 02 01 08 00 00 0a ff fd 02 00 00 00 cf 12
If I manually send Sequence-2 through UART just like the commented lines in main()
above, MCU received responding data. UART rx buffer has something in it. But if I uxr_init_session()
doesn't receive anything.
You are not waiting timeout
in my_custom_transport_read
, also in uxr_set_custom_transport_callbacks
you are setting false
to the framing option, which is required for serial communications
Thank you for your help, I've solve this problem.
It's because I set framing option false
in uxr_set_custom_transport_callbacks()
. Client create session successfully now.
So stream framing is an indispensable builtin feature of Micro-XRCE-DDS-Client?
description
I need to minimize project code and use CMake to build whole project so I need to use Micro-XRCE-DDS-Client rather than Micro-ROS, which use ros2 packages to compile.
client on MCU generate such data sequence when
uxr_init_session(&session, &transport.comm, 0xAAAABBBB)
anduxr_create_session(&session)
were called.Agent seems not to respond to this sequence.
I have another Micro-ROS project and Micro-ROS
rmw_uros_ping_agent(100,1)
function generates such sequence and received response data from Agent.So I'm doubting that the client sent wrong sequence to Agent?
This is code in main()`:
custom porting
Use custom transport - UART
collect the following source files:
Include folders
modified
int64_t uxr_nanos(void)
function insrc/c/utils/time.c
- removeclock_gettime()
and use HAL ticks as time source temporarily.Include generated
config.h
:custom_transport code
a copy from repo - micro_ros_stm32cubemx_utils/extra_sources/microros_transports/it_transport.c: