microRTPS: use FastRTPSGen '-typeros2' option to generate the typenaming required to interface the bridge with ROS2 topics

This commit is contained in:
TSC21
2020-04-02 11:21:20 +01:00
committed by Nuno Marques
parent ab6606aa46
commit 2020b77a43
3 changed files with 41 additions and 16 deletions

View File

@@ -101,14 +101,6 @@ bool @(topic)_Subscriber::init(uint8_t topic_ID, std::condition_variable* t_send
if(mp_participant == nullptr)
return false;
@[if ros2_distro and (ros2_distro == "dashing" or ros2_distro == "eloquent")]@
// Type name should match the expected type name on ROS2
// Note: the change is being done here since the 'fastrtpsgen' example
// generator does not allow to change the type naming on the template of
// "*PubSubTypes.cpp" file
@(topic)DataType.setName("@(package)::msg::dds_::@(topic)_");
@[end if]@
//Register the type
Domain::registerType(mp_participant, static_cast<TopicDataType*>(&@(topic)DataType));