micro-ROS / micro-ROS-Agent

ROS 2 package using Micro XRCE-DDS Agent.
Apache License 2.0
101 stars 58 forks source link

Can't get message of subsceriber:Trying to serialize 13944 in 508 MTU stream #204

Closed Junming-Liang closed 1 year ago

Junming-Liang commented 1 year ago

Issue template

But when I send the msg TargetTrajectory, rosagent out put is:
```shell
[1692612714.928269] warning  | OutputStream.hpp   | push_submessage          | serialization warning  | Trying to serialize 13944 in 508 MTU stream
[1692612715.028242] warning  | OutputStream.hpp   | push_submessage          | serialization warning  | Trying to serialize 13944 in 508 MTU stream

And the program never get inside the callback function of TargetTrajectory subscriber. This is my msg information:

std_msgs/Header header
SensorTime sensor_timestamp
float64 start_gnss_time

float64 total_path_length # in meters​​
float64 total_path_time # in seconds​​

# ============================================
TrajectoryPoint[] trajectory_point
PathPoint[] path_point
string gear 
# ============================================

bool is_estop
string estop_reason

bool is_stop
PathPoint stop_pose
string stop_reason

bool is_replan
string replan_reason

bool car_in_dead_end

# ============================================
uint8 TRACETYPE_GO_STRAIGHT=0 
uint8 TRACETYPE_TURN_LEFT=1
uint8 TRACETYPE_TURN_RIGHT=2
uint8 TRACETYPE_CHANGELINE_LEFT=3
uint8 TRACETYPE_CHANGELINE_RIGHT=4

bool high_beam
bool low_beam
bool horn
bool emergency_light
uint8 trace_type

I eagerly await your response.

Junming-Liang commented 1 year ago

This issue is due to the message size exceeding the MTU size. When using a best effort subscriber, messages are buffered in memory up to the MTU size. Solutions are to adjust the MTU size or switch to using a default subscriber. I will close this issue, but welcome everyone to continue the discussion.