RTI DDS Toolkit for LabVIEW Support

cancel
Showing results for 
Search instead for 
Did you mean: 

Subscribing to topics in ROS2

Solved!
Go to solution

I am publishing data from LabVIEW (Windows 10) using a complex data type and the corresponding Advanced Writer, and I can read the data successfully in a separate LabVIEW process running on the same PC.  I want to subscribe to the topic from ROS2 running on a separate PC (Ubuntu).  The topic shows up in ROS2 but when queried, no data is found.

 

The data type is defined in LabVIEW as a Type Def and is intended to match the ROS2 structure geometry_msgs/msg/WrenchStamped. (CTL file attached)

 

The inputs to the Create Advanced Writer VI are:

  • Domain ID = 0
  • Topic Name = rt/MyTopic
  • Advanced Writer Configuration
    • typeName = "geometry_msgs::msg:dds_::WrenchStamped_"
    • keyName = "header.seq"
    • domainParticipantQoSProfile = "LabVIEWLibrary::DefaultProfile"
    • dataWriterQoSProfile = ""
    • forceArrayMapping? = FALSE
    • forceUnboundedString? = FALSE

 

I found the form of the typeName at https://github.com/SynapseProgramming/ros2labview_guide

 

I have managed to subscribe to simple primitives from LabVIEW in ROS2 using the same setup but the successful use of more complex data types has so far eluded me!  Any suggestions as to where I might be going wrong would be appreciated.

 

PsyenceFact

 

0 Kudos
Message 1 of 7
(686 Views)

Hi PsyenceFact - Can you save for previous?  Minimum LV23.

-Brian
0 Kudos
Message 2 of 7
(649 Views)

Hi Brian,

 

I completely forgot I was using a new version of LV - it doesn't happen very often!  I've created a project with the WrenchStamped type definition, along with it's dependencies which I'd also forgotten, and saved for LV19.

 

Thanks.

 

PsyenceFact

0 Kudos
Message 3 of 7
(643 Views)

PsyenceFact - Awesome, thanks!  I am as far from a ROS expert as exists, but let me offer a few thoughts:

  • Overall, the CTL appears to be an accurate representation of the ROS type.  The only data representation that I couldn't verify in the linked documentation was Time as I32.  Please double-check that it isn't a 64-bit integer, and also check signed/unsigned.
  • The seq parameter of Header does not seem that it would be a keyed type based on the Header documentation.  I suggest try leaving keyName blank.
-Brian
0 Kudos
Message 4 of 7
(633 Views)

Thanks for the suggestions Brian.  The Time message type consists of a long ("sec") and an unsigned long ("nanosec") so the equivalent LV data types are I32 and U32.

https://github.com/rticommunity/ros-data-types/blob/master/std_msgs/msg/Time.idl

 

I did try leaving keyName blank but it made no difference.  I'm wondering if something like the QoS profile from the DDS Toolkit not being available on ROS2 might be part of the problem.  This is my first time working with DDS *and* ROS2 so I'm not sure what can impact what.

 

I've now installed the RTI Connext Admin Console and Monitor on my system so I can do some more in-depth troubleshooting, once I've figured out how to use them.

 

Thanks for your input!

 

PsyenceFact

0 Kudos
Message 5 of 7
(627 Views)

Once you have Admin Console open, the default view should look something like the screenshot below.  Select the topic, then the Match Graph tab in the middle of the screen.  Click on the ROS datawriter, and then you should have info in the other circled tabs (Datatype, QoS, and Match Health).ac_example.png

-Brian
Message 6 of 7
(623 Views)
Solution
Accepted by topic author PsyenceFact

Edit: The data type documentation for WrenchStamped in my original message is actually for the Lunar version of ROS, *not* ROS2.  The correct information for the Header from ROS2 Humble  (the current LTS version) is https://github.com/ros2/common_interfaces/blob/humble/std_msgs/msg/Header.msg.

 

--

 

Thanks for the advice Brian.  Comparing the data I was publishing from LabVIEW with what the subscriber was expecting revealed that the structure of the message header was wrong - I'd somehow picked up information relating to an old version of ROS with the header containing an unnecessary seq field.

 

I can now publish from LabVIEW and subscribe successfully in ROS2 using both predefined data types such as WrenchStamped, and custom data types using an appropriate definition file in ROS2.

 

Thanks once more for your help.

 

PsyenceFact

0 Kudos
Message 7 of 7
(582 Views)