Skip to content

Commit 5baefd3

Browse files
authored
Merge pull request #61 from RosProBridge/feat/ros1-latch-support
ROS1 latch support
2 parents 5d9705e + e572c86 commit 5baefd3

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

Runtime/Core/ProBridge.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,14 @@ public class Msg
3232

3333
#if ROS_V2
3434
/// <summary>
35-
/// Quality od service, like as "qos_profile_system_default" or "qos_profile_sensor_data"
35+
/// Quality of service, like as "qos_profile_system_default" or "qos_profile_sensor_data"
3636
/// </summary>
3737
public Qos q;
38+
#else
39+
/// <summary>
40+
/// Latching flag for the message. If true, the message is a latched version of the previous message.
41+
/// </summary>
42+
public bool l = false;
3843
#endif
3944
/// <summary>
4045
/// Data Compression Level (0-9)
@@ -100,6 +105,8 @@ public void SendMsg(PushSocket pushSocket, Msg msg)
100105
{ "n", msg.n },
101106
#if ROS_V2
102107
{ "q", msg.q.GetValue() },
108+
#else
109+
{ "l", msg.l },
103110
#endif
104111
{ "c", msg.c }
105112
};
@@ -206,6 +213,8 @@ private Msg DeserializeMessage(byte[] headerBytes)
206213
msg.n = (string)messageData["n"];
207214
#if ROS_V2
208215
msg.q = new Qos(messageData["q"]);
216+
#else
217+
msg.l = (bool)messageData["l"];
209218
#endif
210219
msg.c = (int)tmpC;
211220

Runtime/Tx/Tf/TfSender.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,8 @@ protected void SendMsg(bool staticT = false)
173173
c = compressionLevel,
174174
#if ROS_V2
175175
q = staticT ? __staticQos : __dynamicQos,
176+
#else
177+
l = staticT,
176178
#endif
177179
d = data
178180
};

0 commit comments

Comments
 (0)