mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-16 10:53:34 +08:00
microRTPS: send the system ID with the RTPS packet header and remove the need for extra id fields in uORB
This allows that all messages (not only timesync messages) that get received on the same system that sent them do not get parsed. As the microRTPS agent is built currently, this will only happen right now if someone sets the same UDP port to send and receive data, or by manually changing the agent topics (which were always autogenerated).
This commit is contained in:
@@ -140,11 +140,10 @@ void *send(void *args)
|
||||
if (subs->@(topic)_sub.update(&@(topic)_data))
|
||||
{
|
||||
@[ if topic == 'Timesync' or topic == 'timesync']@
|
||||
if (@(topic)_data.sys_id == 0 && @(topic)_data.seq != last_remote_msg_seq && @(topic)_data.tc1 == 0) {
|
||||
if (@(topic)_data.seq != last_remote_msg_seq && @(topic)_data.tc1 == 0) {
|
||||
last_remote_msg_seq = @(topic)_data.seq;
|
||||
|
||||
@(topic)_data.timestamp = hrt_absolute_time();
|
||||
@(topic)_data.sys_id = 1;
|
||||
@(topic)_data.seq = last_msg_seq;
|
||||
@(topic)_data.tc1 = hrt_absolute_time() * 1000ULL;
|
||||
@(topic)_data.ts1 = @(topic)_data.ts1;
|
||||
|
||||
Reference in New Issue
Block a user