diff --git a/third-party/realdds/include/realdds/topics/image-msg.h b/third-party/realdds/include/realdds/topics/image-msg.h index 0184e00e8d..920cf5e17d 100644 --- a/third-party/realdds/include/realdds/topics/image-msg.h +++ b/third-party/realdds/include/realdds/topics/image-msg.h @@ -1,11 +1,11 @@ // License: Apache 2.0. See LICENSE file in root directory. -// Copyright(c) 2022-4 Intel Corporation. All Rights Reserved. +// Copyright(c) 2022-5 Intel Corporation. All Rights Reserved. #pragma once #include #include -#include +#include #include #include diff --git a/third-party/realdds/include/realdds/topics/imu-msg.h b/third-party/realdds/include/realdds/topics/imu-msg.h index 98228b804e..7564edbc80 100644 --- a/third-party/realdds/include/realdds/topics/imu-msg.h +++ b/third-party/realdds/include/realdds/topics/imu-msg.h @@ -1,11 +1,11 @@ // License: Apache 2.0. See LICENSE file in root directory. -// Copyright(c) 2023-4 Intel Corporation. All Rights Reserved. +// Copyright(c) 2023-5 Intel Corporation. All Rights Reserved. #pragma once #include #include -#include +#include #include #include diff --git a/third-party/realdds/include/realdds/topics/ros2/ros2time.h b/third-party/realdds/include/realdds/topics/ros2/builtin_interfaces/msg/Time.h similarity index 87% rename from third-party/realdds/include/realdds/topics/ros2/ros2time.h rename to third-party/realdds/include/realdds/topics/ros2/builtin_interfaces/msg/Time.h index 781a81fdcd..6d087b2b2c 100644 --- a/third-party/realdds/include/realdds/topics/ros2/ros2time.h +++ b/third-party/realdds/include/realdds/topics/ros2/builtin_interfaces/msg/Time.h @@ -1,5 +1,5 @@ // License: Apache 2.0. See LICENSE file in root directory. -// Copyright(c) 2023 Intel Corporation. All Rights Reserved. +// Copyright(c) 2023-5 Intel Corporation. All Rights Reserved. /*! * @file Time.h @@ -8,8 +8,8 @@ * This file was generated by the tool gen. */ -#ifndef _FAST_DDS_GENERATED_STD_MSGS_MSG_TIME_H_ -#define _FAST_DDS_GENERATED_STD_MSGS_MSG_TIME_H_ +#ifndef _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_TIME_H_ +#define _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_TIME_H_ //#include @@ -52,7 +52,7 @@ class Cdr; } // namespace eprosima -namespace std_msgs { +namespace builtin_interfaces { namespace msg { /*! * @brief This class represents the structure Time defined by the user in the IDL file. @@ -74,42 +74,42 @@ namespace std_msgs { /*! * @brief Copy constructor. - * @param x Reference to the object std_msgs::msg::Time that will be copied. + * @param x Reference to the object builtin_interfaces::msg::Time that will be copied. */ eProsima_user_DllExport Time( const Time& x); /*! * @brief Move constructor. - * @param x Reference to the object std_msgs::msg::Time that will be copied. + * @param x Reference to the object builtin_interfaces::msg::Time that will be copied. */ eProsima_user_DllExport Time( Time&& x) noexcept; /*! * @brief Copy assignment. - * @param x Reference to the object std_msgs::msg::Time that will be copied. + * @param x Reference to the object builtin_interfaces::msg::Time that will be copied. */ eProsima_user_DllExport Time& operator =( const Time& x); /*! * @brief Move assignment. - * @param x Reference to the object std_msgs::msg::Time that will be copied. + * @param x Reference to the object builtin_interfaces::msg::Time that will be copied. */ eProsima_user_DllExport Time& operator =( Time&& x) noexcept; /*! * @brief Comparison operator. - * @param x std_msgs::msg::Time object to compare. + * @param x builtin_interfaces::msg::Time object to compare. */ eProsima_user_DllExport bool operator ==( const Time& x) const; /*! * @brief Comparison operator. - * @param x std_msgs::msg::Time object to compare. + * @param x builtin_interfaces::msg::Time object to compare. */ eProsima_user_DllExport bool operator !=( const Time& x) const; @@ -169,7 +169,7 @@ namespace std_msgs { * @return Serialized size. */ eProsima_user_DllExport static size_t getCdrSerializedSize( - const std_msgs::msg::Time& data, + const builtin_interfaces::msg::Time& data, size_t current_alignment = 0); @@ -216,6 +216,6 @@ namespace std_msgs { uint32_t m_nanosec; }; } // namespace msg -} // namespace std_msgs +} // namespace builtin_interfaces -#endif // _FAST_DDS_GENERATED_STD_MSGS_MSG_TIME_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_TIME_H_ \ No newline at end of file diff --git a/third-party/realdds/include/realdds/topics/ros2/ros2timePubSubTypes.h b/third-party/realdds/include/realdds/topics/ros2/builtin_interfaces/msg/TimePubSubTypes.h similarity index 89% rename from third-party/realdds/include/realdds/topics/ros2/ros2timePubSubTypes.h rename to third-party/realdds/include/realdds/topics/ros2/builtin_interfaces/msg/TimePubSubTypes.h index 1db7ca57dd..ce0ae70a82 100644 --- a/third-party/realdds/include/realdds/topics/ros2/ros2timePubSubTypes.h +++ b/third-party/realdds/include/realdds/topics/ros2/builtin_interfaces/msg/TimePubSubTypes.h @@ -1,5 +1,5 @@ // License: Apache 2.0. See LICENSE file in root directory. -// Copyright(c) 2023 Intel Corporation. All Rights Reserved. +// Copyright(c) 2023-5 Intel Corporation. All Rights Reserved. /*! * @file TimePubSubTypes.h @@ -9,20 +9,20 @@ */ -#ifndef _FAST_DDS_GENERATED_STD_MSGS_MSG_TIME_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_STD_MSGS_MSG_TIME_PUBSUBTYPES_H_ +#ifndef _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_TIME_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_TIME_PUBSUBTYPES_H_ #include #include -#include "ros2time.h" +#include "Time.h" #if !defined(GEN_API_VER) || (GEN_API_VER != 1) #error \ Generated Time is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER -namespace std_msgs +namespace builtin_interfaces { namespace msg { @@ -93,4 +93,4 @@ namespace std_msgs } } -#endif // _FAST_DDS_GENERATED_STD_MSGS_MSG_TIME_PUBSUBTYPES_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_TIME_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/third-party/realdds/include/realdds/topics/ros2/ros2quaternion.h b/third-party/realdds/include/realdds/topics/ros2/geometry_msgs/msg/Quaternion.h similarity index 100% rename from third-party/realdds/include/realdds/topics/ros2/ros2quaternion.h rename to third-party/realdds/include/realdds/topics/ros2/geometry_msgs/msg/Quaternion.h diff --git a/third-party/realdds/include/realdds/topics/ros2/ros2quaternionPubSubTypes.h b/third-party/realdds/include/realdds/topics/ros2/geometry_msgs/msg/QuaternionPubSubTypes.h similarity index 96% rename from third-party/realdds/include/realdds/topics/ros2/ros2quaternionPubSubTypes.h rename to third-party/realdds/include/realdds/topics/ros2/geometry_msgs/msg/QuaternionPubSubTypes.h index c96248fd4a..a64baedb01 100644 --- a/third-party/realdds/include/realdds/topics/ros2/ros2quaternionPubSubTypes.h +++ b/third-party/realdds/include/realdds/topics/ros2/geometry_msgs/msg/QuaternionPubSubTypes.h @@ -1,5 +1,5 @@ // License: Apache 2.0. See LICENSE file in root directory. -// Copyright(c) 2023 Intel Corporation. All Rights Reserved. +// Copyright(c) 2023-5 Intel Corporation. All Rights Reserved. /*! * @file QuaternionPubSubTypes.h @@ -15,7 +15,7 @@ #include #include -#include +#include "Quaternion.h" #if !defined(GEN_API_VER) || (GEN_API_VER != 1) #error \ diff --git a/third-party/realdds/include/realdds/topics/ros2/ros2vector3.h b/third-party/realdds/include/realdds/topics/ros2/geometry_msgs/msg/Vector3.h similarity index 100% rename from third-party/realdds/include/realdds/topics/ros2/ros2vector3.h rename to third-party/realdds/include/realdds/topics/ros2/geometry_msgs/msg/Vector3.h diff --git a/third-party/realdds/include/realdds/topics/ros2/ros2vector3PubSubTypes.h b/third-party/realdds/include/realdds/topics/ros2/geometry_msgs/msg/Vector3PubSubTypes.h similarity index 97% rename from third-party/realdds/include/realdds/topics/ros2/ros2vector3PubSubTypes.h rename to third-party/realdds/include/realdds/topics/ros2/geometry_msgs/msg/Vector3PubSubTypes.h index d5de7404fb..15cf4fd688 100644 --- a/third-party/realdds/include/realdds/topics/ros2/ros2vector3PubSubTypes.h +++ b/third-party/realdds/include/realdds/topics/ros2/geometry_msgs/msg/Vector3PubSubTypes.h @@ -1,5 +1,5 @@ // License: Apache 2.0. See LICENSE file in root directory. -// Copyright(c) 2023 Intel Corporation. All Rights Reserved. +// Copyright(c) 2023-5 Intel Corporation. All Rights Reserved. /*! * @file Vector3PubSubTypes.h @@ -15,7 +15,7 @@ #include #include -#include "ros2vector3.h" +#include "Vector3.h" #if !defined(GEN_API_VER) || (GEN_API_VER != 1) #error \ diff --git a/third-party/realdds/include/realdds/topics/ros2/ros2image.h b/third-party/realdds/include/realdds/topics/ros2/sensor_msgs/msg/Image.h similarity index 99% rename from third-party/realdds/include/realdds/topics/ros2/ros2image.h rename to third-party/realdds/include/realdds/topics/ros2/sensor_msgs/msg/Image.h index 309d1ce130..ec3532735f 100644 --- a/third-party/realdds/include/realdds/topics/ros2/ros2image.h +++ b/third-party/realdds/include/realdds/topics/ros2/sensor_msgs/msg/Image.h @@ -1,5 +1,5 @@ // License: Apache 2.0. See LICENSE file in root directory. -// Copyright(c) 2023 Intel Corporation. All Rights Reserved. +// Copyright(c) 2023-5 Intel Corporation. All Rights Reserved. /*! * @file Image.h @@ -11,7 +11,7 @@ #ifndef _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_IMAGE_H_ #define _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_IMAGE_H_ -#include "ros2header.h" +#include "../../std_msgs/msg/Header.h" //#include diff --git a/third-party/realdds/include/realdds/topics/ros2/ros2imagePubSubTypes.h b/third-party/realdds/include/realdds/topics/ros2/sensor_msgs/msg/ImagePubSubTypes.h similarity index 97% rename from third-party/realdds/include/realdds/topics/ros2/ros2imagePubSubTypes.h rename to third-party/realdds/include/realdds/topics/ros2/sensor_msgs/msg/ImagePubSubTypes.h index 9803f5c2f1..8d68e0828c 100644 --- a/third-party/realdds/include/realdds/topics/ros2/ros2imagePubSubTypes.h +++ b/third-party/realdds/include/realdds/topics/ros2/sensor_msgs/msg/ImagePubSubTypes.h @@ -1,5 +1,5 @@ // License: Apache 2.0. See LICENSE file in root directory. -// Copyright(c) 2023 Intel Corporation. All Rights Reserved. +// Copyright(c) 2023-5 Intel Corporation. All Rights Reserved. /*! * @file ImagePubSubTypes.h @@ -15,7 +15,7 @@ #include #include -#include "ros2image.h" +#include "Image.h" #if !defined(GEN_API_VER) || (GEN_API_VER != 1) #error \ diff --git a/third-party/realdds/include/realdds/topics/ros2/ros2imu.h b/third-party/realdds/include/realdds/topics/ros2/sensor_msgs/msg/Imu.h similarity index 87% rename from third-party/realdds/include/realdds/topics/ros2/ros2imu.h rename to third-party/realdds/include/realdds/topics/ros2/sensor_msgs/msg/Imu.h index 28acf4161a..787dd2f81f 100644 --- a/third-party/realdds/include/realdds/topics/ros2/ros2imu.h +++ b/third-party/realdds/include/realdds/topics/ros2/sensor_msgs/msg/Imu.h @@ -1,5 +1,5 @@ // License: Apache 2.0. See LICENSE file in root directory. -// Copyright(c) 2023 Intel Corporation. All Rights Reserved. +// Copyright(c) 2023-5 Intel Corporation. All Rights Reserved. /*! * @file Imu.h @@ -11,9 +11,9 @@ #ifndef _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_IMU_H_ #define _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_IMU_H_ -#include -#include -#include +#include "../../geometry_msgs/msg/Vector3.h" +#include "../../geometry_msgs/msg/Quaternion.h" +#include "../../std_msgs/msg/Header.h" #include @@ -57,7 +57,7 @@ class Cdr; namespace sensor_msgs { namespace msg { - typedef std::array sensor_msgs__Imu__double_array_9; + typedef std::array double__9; /*! * @brief This class represents the structure Imu defined by the user in the IDL file. * @ingroup IMU @@ -173,26 +173,26 @@ namespace sensor_msgs { * @param _orientation_covariance New value to be copied in member orientation_covariance */ eProsima_user_DllExport void orientation_covariance( - const sensor_msgs::msg::sensor_msgs__Imu__double_array_9& _orientation_covariance); + const sensor_msgs::msg::double__9& _orientation_covariance); /*! * @brief This function moves the value in member orientation_covariance * @param _orientation_covariance New value to be moved in member orientation_covariance */ eProsima_user_DllExport void orientation_covariance( - sensor_msgs::msg::sensor_msgs__Imu__double_array_9&& _orientation_covariance); + sensor_msgs::msg::double__9&& _orientation_covariance); /*! * @brief This function returns a constant reference to member orientation_covariance * @return Constant reference to member orientation_covariance */ - eProsima_user_DllExport const sensor_msgs::msg::sensor_msgs__Imu__double_array_9& orientation_covariance() const; + eProsima_user_DllExport const sensor_msgs::msg::double__9& orientation_covariance() const; /*! * @brief This function returns a reference to member orientation_covariance * @return Reference to member orientation_covariance */ - eProsima_user_DllExport sensor_msgs::msg::sensor_msgs__Imu__double_array_9& orientation_covariance(); + eProsima_user_DllExport sensor_msgs::msg::double__9& orientation_covariance(); /*! * @brief This function copies the value in member angular_velocity * @param _angular_velocity New value to be copied in member angular_velocity @@ -223,26 +223,26 @@ namespace sensor_msgs { * @param _angular_velocity_covariance New value to be copied in member angular_velocity_covariance */ eProsima_user_DllExport void angular_velocity_covariance( - const sensor_msgs::msg::sensor_msgs__Imu__double_array_9& _angular_velocity_covariance); + const sensor_msgs::msg::double__9& _angular_velocity_covariance); /*! * @brief This function moves the value in member angular_velocity_covariance * @param _angular_velocity_covariance New value to be moved in member angular_velocity_covariance */ eProsima_user_DllExport void angular_velocity_covariance( - sensor_msgs::msg::sensor_msgs__Imu__double_array_9&& _angular_velocity_covariance); + sensor_msgs::msg::double__9&& _angular_velocity_covariance); /*! * @brief This function returns a constant reference to member angular_velocity_covariance * @return Constant reference to member angular_velocity_covariance */ - eProsima_user_DllExport const sensor_msgs::msg::sensor_msgs__Imu__double_array_9& angular_velocity_covariance() const; + eProsima_user_DllExport const sensor_msgs::msg::double__9& angular_velocity_covariance() const; /*! * @brief This function returns a reference to member angular_velocity_covariance * @return Reference to member angular_velocity_covariance */ - eProsima_user_DllExport sensor_msgs::msg::sensor_msgs__Imu__double_array_9& angular_velocity_covariance(); + eProsima_user_DllExport sensor_msgs::msg::double__9& angular_velocity_covariance(); /*! * @brief This function copies the value in member linear_acceleration * @param _linear_acceleration New value to be copied in member linear_acceleration @@ -273,26 +273,26 @@ namespace sensor_msgs { * @param _linear_acceleration_covariance New value to be copied in member linear_acceleration_covariance */ eProsima_user_DllExport void linear_acceleration_covariance( - const sensor_msgs::msg::sensor_msgs__Imu__double_array_9& _linear_acceleration_covariance); + const sensor_msgs::msg::double__9& _linear_acceleration_covariance); /*! * @brief This function moves the value in member linear_acceleration_covariance * @param _linear_acceleration_covariance New value to be moved in member linear_acceleration_covariance */ eProsima_user_DllExport void linear_acceleration_covariance( - sensor_msgs::msg::sensor_msgs__Imu__double_array_9&& _linear_acceleration_covariance); + sensor_msgs::msg::double__9&& _linear_acceleration_covariance); /*! * @brief This function returns a constant reference to member linear_acceleration_covariance * @return Constant reference to member linear_acceleration_covariance */ - eProsima_user_DllExport const sensor_msgs::msg::sensor_msgs__Imu__double_array_9& linear_acceleration_covariance() const; + eProsima_user_DllExport const sensor_msgs::msg::double__9& linear_acceleration_covariance() const; /*! * @brief This function returns a reference to member linear_acceleration_covariance * @return Reference to member linear_acceleration_covariance */ - eProsima_user_DllExport sensor_msgs::msg::sensor_msgs__Imu__double_array_9& linear_acceleration_covariance(); + eProsima_user_DllExport sensor_msgs::msg::double__9& linear_acceleration_covariance(); /*! * @brief This function returns the maximum serialized size of an object @@ -355,11 +355,11 @@ namespace sensor_msgs { std_msgs::msg::Header m_header; geometry_msgs::msg::Quaternion m_orientation; - sensor_msgs::msg::sensor_msgs__Imu__double_array_9 m_orientation_covariance; + sensor_msgs::msg::double__9 m_orientation_covariance; geometry_msgs::msg::Vector3 m_angular_velocity; - sensor_msgs::msg::sensor_msgs__Imu__double_array_9 m_angular_velocity_covariance; + sensor_msgs::msg::double__9 m_angular_velocity_covariance; geometry_msgs::msg::Vector3 m_linear_acceleration; - sensor_msgs::msg::sensor_msgs__Imu__double_array_9 m_linear_acceleration_covariance; + sensor_msgs::msg::double__9 m_linear_acceleration_covariance; }; } // namespace msg } // namespace sensor_msgs diff --git a/third-party/realdds/include/realdds/topics/ros2/ros2imuPubSubTypes.h b/third-party/realdds/include/realdds/topics/ros2/sensor_msgs/msg/ImuPubSubTypes.h similarity index 94% rename from third-party/realdds/include/realdds/topics/ros2/ros2imuPubSubTypes.h rename to third-party/realdds/include/realdds/topics/ros2/sensor_msgs/msg/ImuPubSubTypes.h index 6cf75b53de..0311c68d2e 100644 --- a/third-party/realdds/include/realdds/topics/ros2/ros2imuPubSubTypes.h +++ b/third-party/realdds/include/realdds/topics/ros2/sensor_msgs/msg/ImuPubSubTypes.h @@ -1,5 +1,5 @@ // License: Apache 2.0. See LICENSE file in root directory. -// Copyright(c) 2023 Intel Corporation. All Rights Reserved. +// Copyright(c) 2023-5 Intel Corporation. All Rights Reserved. /*! * @file ImuPubSubTypes.h @@ -15,7 +15,7 @@ #include #include -#include +#include "Imu.h" #if !defined(GEN_API_VER) || (GEN_API_VER != 1) #error \ @@ -26,7 +26,7 @@ namespace sensor_msgs { namespace msg { - typedef std::array sensor_msgs__Imu__double_array_9; + typedef std::array double__9; /*! * @brief This class represents the TopicDataType of the type Imu defined by the user in the IDL file. * @ingroup IMU diff --git a/third-party/realdds/include/realdds/topics/ros2/ros2header.h b/third-party/realdds/include/realdds/topics/ros2/std_msgs/msg/Header.h similarity index 94% rename from third-party/realdds/include/realdds/topics/ros2/ros2header.h rename to third-party/realdds/include/realdds/topics/ros2/std_msgs/msg/Header.h index 1373243f33..73e43827d3 100644 --- a/third-party/realdds/include/realdds/topics/ros2/ros2header.h +++ b/third-party/realdds/include/realdds/topics/ros2/std_msgs/msg/Header.h @@ -1,5 +1,5 @@ // License: Apache 2.0. See LICENSE file in root directory. -// Copyright(c) 2023 Intel Corporation. All Rights Reserved. +// Copyright(c) 2023-5 Intel Corporation. All Rights Reserved. /*! * @file Header.h @@ -11,7 +11,7 @@ #ifndef _FAST_DDS_GENERATED_STD_MSGS_MSG_HEADER_H_ #define _FAST_DDS_GENERATED_STD_MSGS_MSG_HEADER_H_ -#include "ros2time.h" +#include //#include @@ -120,26 +120,26 @@ namespace std_msgs { * @param _stamp New value to be copied in member stamp */ eProsima_user_DllExport void stamp( - const std_msgs::msg::Time& _stamp); + const builtin_interfaces::msg::Time& _stamp); /*! * @brief This function moves the value in member stamp * @param _stamp New value to be moved in member stamp */ eProsima_user_DllExport void stamp( - std_msgs::msg::Time&& _stamp); + builtin_interfaces::msg::Time&& _stamp); /*! * @brief This function returns a constant reference to member stamp * @return Constant reference to member stamp */ - eProsima_user_DllExport const std_msgs::msg::Time& stamp() const; + eProsima_user_DllExport const builtin_interfaces::msg::Time& stamp() const; /*! * @brief This function returns a reference to member stamp * @return Reference to member stamp */ - eProsima_user_DllExport std_msgs::msg::Time& stamp(); + eProsima_user_DllExport builtin_interfaces::msg::Time& stamp(); /*! * @brief This function copies the value in member frame_id * @param _frame_id New value to be copied in member frame_id @@ -225,7 +225,7 @@ namespace std_msgs { private: - std_msgs::msg::Time m_stamp; + builtin_interfaces::msg::Time m_stamp; std::string m_frame_id; }; } // namespace msg diff --git a/third-party/realdds/include/realdds/topics/ros2/ros2headerPubSubTypes.h b/third-party/realdds/include/realdds/topics/ros2/std_msgs/msg/HeaderPubSubTypes.h similarity index 97% rename from third-party/realdds/include/realdds/topics/ros2/ros2headerPubSubTypes.h rename to third-party/realdds/include/realdds/topics/ros2/std_msgs/msg/HeaderPubSubTypes.h index 13c8312a0f..db36500b5f 100644 --- a/third-party/realdds/include/realdds/topics/ros2/ros2headerPubSubTypes.h +++ b/third-party/realdds/include/realdds/topics/ros2/std_msgs/msg/HeaderPubSubTypes.h @@ -1,5 +1,5 @@ // License: Apache 2.0. See LICENSE file in root directory. -// Copyright(c) 2023 Intel Corporation. All Rights Reserved. +// Copyright(c) 2023-5 Intel Corporation. All Rights Reserved. /*! * @file HeaderPubSubTypes.h @@ -15,7 +15,7 @@ #include #include -#include "ros2header.h" +#include "Header.h" #if !defined(GEN_API_VER) || (GEN_API_VER != 1) #error \ diff --git a/third-party/realdds/py/pyrealdds.cpp b/third-party/realdds/py/pyrealdds.cpp index bb1e1b5198..2daa827eed 100644 --- a/third-party/realdds/py/pyrealdds.cpp +++ b/third-party/realdds/py/pyrealdds.cpp @@ -10,8 +10,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/third-party/realdds/src/dds-stream-server.cpp b/third-party/realdds/src/dds-stream-server.cpp index d72b871d61..c5be0a296c 100644 --- a/third-party/realdds/src/dds-stream-server.cpp +++ b/third-party/realdds/src/dds-stream-server.cpp @@ -11,8 +11,6 @@ #include #include #include -#include -#include #include #include diff --git a/third-party/realdds/src/topics/image-msg.cpp b/third-party/realdds/src/topics/image-msg.cpp index 44f1d8f2c3..69f1427927 100644 --- a/third-party/realdds/src/topics/image-msg.cpp +++ b/third-party/realdds/src/topics/image-msg.cpp @@ -1,9 +1,8 @@ // License: Apache 2.0. See LICENSE file in root directory. -// Copyright(c) 2022-4 Intel Corporation. All Rights Reserved. +// Copyright(c) 2022-5 Intel Corporation. All Rights Reserved. -#include #include -#include +#include #include #include diff --git a/third-party/realdds/src/topics/imu-msg.cpp b/third-party/realdds/src/topics/imu-msg.cpp index e5b2245094..e006d307d5 100644 --- a/third-party/realdds/src/topics/imu-msg.cpp +++ b/third-party/realdds/src/topics/imu-msg.cpp @@ -1,9 +1,8 @@ // License: Apache 2.0. See LICENSE file in root directory. -// Copyright(c) 2023-4 Intel Corporation. All Rights Reserved. +// Copyright(c) 2023-5 Intel Corporation. All Rights Reserved. -#include #include -#include +#include #include #include diff --git a/third-party/realdds/src/topics/ros2/ros2time.cpp b/third-party/realdds/src/topics/ros2/builtin_interfaces/msg/Time.cpp similarity index 70% rename from third-party/realdds/src/topics/ros2/ros2time.cpp rename to third-party/realdds/src/topics/ros2/builtin_interfaces/msg/Time.cpp index 9e0d06006f..836f281842 100644 --- a/third-party/realdds/src/topics/ros2/ros2time.cpp +++ b/third-party/realdds/src/topics/ros2/builtin_interfaces/msg/Time.cpp @@ -1,5 +1,5 @@ // License: Apache 2.0. See LICENSE file in root directory. -// Copyright(c) 2023 Intel Corporation. All Rights Reserved. +// Copyright(c) 2023-5 Intel Corporation. All Rights Reserved. /*! * @file Time.cpp @@ -15,8 +15,8 @@ char dummy; } // namespace #endif // _WIN32 -#include -#include "ros2timeTypeObject.h" +#include +#include "TimeTypeObject.h" #include #include @@ -24,38 +24,38 @@ using namespace eprosima::fastcdr::exception; #include -std_msgs::msg::Time::Time() +builtin_interfaces::msg::Time::Time() { - // m_sec com.eprosima.idl.parser.typecode.PrimitiveTypeCode@5ae50ce6 + // m_sec com.eprosima.idl.parser.typecode.PrimitiveTypeCode@371a67ec m_sec = 0; - // m_nanosec com.eprosima.idl.parser.typecode.PrimitiveTypeCode@6f96c77 + // m_nanosec com.eprosima.idl.parser.typecode.PrimitiveTypeCode@5ed828d m_nanosec = 0; // Just to register all known types registerTimeTypes(); } -std_msgs::msg::Time::~Time() +builtin_interfaces::msg::Time::~Time() { } -std_msgs::msg::Time::Time( +builtin_interfaces::msg::Time::Time( const Time& x) { m_sec = x.m_sec; m_nanosec = x.m_nanosec; } -std_msgs::msg::Time::Time( +builtin_interfaces::msg::Time::Time( Time&& x) noexcept { m_sec = x.m_sec; m_nanosec = x.m_nanosec; } -std_msgs::msg::Time& std_msgs::msg::Time::operator =( +builtin_interfaces::msg::Time& builtin_interfaces::msg::Time::operator =( const Time& x) { @@ -65,7 +65,7 @@ std_msgs::msg::Time& std_msgs::msg::Time::operator =( return *this; } -std_msgs::msg::Time& std_msgs::msg::Time::operator =( +builtin_interfaces::msg::Time& builtin_interfaces::msg::Time::operator =( Time&& x) noexcept { @@ -75,20 +75,20 @@ std_msgs::msg::Time& std_msgs::msg::Time::operator =( return *this; } -bool std_msgs::msg::Time::operator ==( +bool builtin_interfaces::msg::Time::operator ==( const Time& x) const { return (m_sec == x.m_sec && m_nanosec == x.m_nanosec); } -bool std_msgs::msg::Time::operator !=( +bool builtin_interfaces::msg::Time::operator !=( const Time& x) const { return !(*this == x); } -size_t std_msgs::msg::Time::getMaxCdrSerializedSize( +size_t builtin_interfaces::msg::Time::getMaxCdrSerializedSize( size_t current_alignment) { size_t initial_alignment = current_alignment; @@ -104,8 +104,8 @@ size_t std_msgs::msg::Time::getMaxCdrSerializedSize( return current_alignment - initial_alignment; } -size_t std_msgs::msg::Time::getCdrSerializedSize( - const std_msgs::msg::Time& data, +size_t builtin_interfaces::msg::Time::getCdrSerializedSize( + const builtin_interfaces::msg::Time& data, size_t current_alignment) { (void)data; @@ -122,7 +122,7 @@ size_t std_msgs::msg::Time::getCdrSerializedSize( return current_alignment - initial_alignment; } -void std_msgs::msg::Time::serialize( +void builtin_interfaces::msg::Time::serialize( eprosima::fastcdr::Cdr& scdr) const { @@ -131,7 +131,7 @@ void std_msgs::msg::Time::serialize( } -void std_msgs::msg::Time::deserialize( +void builtin_interfaces::msg::Time::deserialize( eprosima::fastcdr::Cdr& dcdr) { @@ -143,7 +143,7 @@ void std_msgs::msg::Time::deserialize( * @brief This function sets a value in member sec * @param _sec New value for member sec */ -void std_msgs::msg::Time::sec( +void builtin_interfaces::msg::Time::sec( int32_t _sec) { m_sec = _sec; @@ -153,7 +153,7 @@ void std_msgs::msg::Time::sec( * @brief This function returns the value of member sec * @return Value of member sec */ -int32_t std_msgs::msg::Time::sec() const +int32_t builtin_interfaces::msg::Time::sec() const { return m_sec; } @@ -162,7 +162,7 @@ int32_t std_msgs::msg::Time::sec() const * @brief This function returns a reference to member sec * @return Reference to member sec */ -int32_t& std_msgs::msg::Time::sec() +int32_t& builtin_interfaces::msg::Time::sec() { return m_sec; } @@ -171,7 +171,7 @@ int32_t& std_msgs::msg::Time::sec() * @brief This function sets a value in member nanosec * @param _nanosec New value for member nanosec */ -void std_msgs::msg::Time::nanosec( +void builtin_interfaces::msg::Time::nanosec( uint32_t _nanosec) { m_nanosec = _nanosec; @@ -181,7 +181,7 @@ void std_msgs::msg::Time::nanosec( * @brief This function returns the value of member nanosec * @return Value of member nanosec */ -uint32_t std_msgs::msg::Time::nanosec() const +uint32_t builtin_interfaces::msg::Time::nanosec() const { return m_nanosec; } @@ -190,13 +190,13 @@ uint32_t std_msgs::msg::Time::nanosec() const * @brief This function returns a reference to member nanosec * @return Reference to member nanosec */ -uint32_t& std_msgs::msg::Time::nanosec() +uint32_t& builtin_interfaces::msg::Time::nanosec() { return m_nanosec; } -size_t std_msgs::msg::Time::getKeyMaxCdrSerializedSize( +size_t builtin_interfaces::msg::Time::getKeyMaxCdrSerializedSize( size_t current_alignment) { size_t current_align = current_alignment; @@ -208,12 +208,12 @@ size_t std_msgs::msg::Time::getKeyMaxCdrSerializedSize( return current_align; } -bool std_msgs::msg::Time::isKeyDefined() +bool builtin_interfaces::msg::Time::isKeyDefined() { return false; } -void std_msgs::msg::Time::serializeKey( +void builtin_interfaces::msg::Time::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; diff --git a/third-party/realdds/src/topics/ros2/ros2timePubSubTypes.cpp b/third-party/realdds/src/topics/ros2/builtin_interfaces/msg/TimePubSubTypes.cpp similarity index 95% rename from third-party/realdds/src/topics/ros2/ros2timePubSubTypes.cpp rename to third-party/realdds/src/topics/ros2/builtin_interfaces/msg/TimePubSubTypes.cpp index 52ae23acc3..30a53a0691 100644 --- a/third-party/realdds/src/topics/ros2/ros2timePubSubTypes.cpp +++ b/third-party/realdds/src/topics/ros2/builtin_interfaces/msg/TimePubSubTypes.cpp @@ -1,5 +1,5 @@ // License: Apache 2.0. See LICENSE file in root directory. -// Copyright(c) 2023 Intel Corporation. All Rights Reserved. +// Copyright(c) 2023-5 Intel Corporation. All Rights Reserved. /*! * @file TimePubSubTypes.cpp @@ -12,16 +12,16 @@ #include #include -#include +#include using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; -namespace std_msgs { +namespace builtin_interfaces { namespace msg { TimePubSubType::TimePubSubType() { - setName("std_msgs::msg::Time"); + setName("builtin_interfaces::msg::dds_::Time_"); auto type_size = Time::getMaxCdrSerializedSize(); type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ @@ -162,4 +162,4 @@ namespace std_msgs { } //End of namespace msg -} //End of namespace std_msgs +} //End of namespace builtin_interfaces diff --git a/third-party/realdds/src/topics/ros2/ros2timeTypeObject.cpp b/third-party/realdds/src/topics/ros2/builtin_interfaces/msg/TimeTypeObject.cpp similarity index 62% rename from third-party/realdds/src/topics/ros2/ros2timeTypeObject.cpp rename to third-party/realdds/src/topics/ros2/builtin_interfaces/msg/TimeTypeObject.cpp index ffe65d73fc..47ddf3e826 100644 --- a/third-party/realdds/src/topics/ros2/ros2timeTypeObject.cpp +++ b/third-party/realdds/src/topics/ros2/builtin_interfaces/msg/TimeTypeObject.cpp @@ -1,5 +1,5 @@ // License: Apache 2.0. See LICENSE file in root directory. -// Copyright(c) 2023 Intel Corporation. All Rights Reserved. +// Copyright(c) 2023-5 Intel Corporation. All Rights Reserved. /*! * @file TimeTypeObject.cpp @@ -13,8 +13,8 @@ namespace { char dummy; } #endif -#include -#include "ros2timeTypeObject.h" +#include +#include "TimeTypeObject.h" #include #include #include @@ -30,16 +30,16 @@ using namespace eprosima::fastrtps::rtps; void registerTimeTypes() { TypeObjectFactory *factory = TypeObjectFactory::get_instance(); - factory->add_type_object("std_msgs::msg::Time", std_msgs::msg::GetTimeIdentifier(true), - std_msgs::msg::GetTimeObject(true)); - factory->add_type_object("std_msgs::msg::Time", std_msgs::msg::GetTimeIdentifier(false), - std_msgs::msg::GetTimeObject(false)); + factory->add_type_object("builtin_interfaces::msg::Time", builtin_interfaces::msg::GetTimeIdentifier(true), + builtin_interfaces::msg::GetTimeObject(true)); + factory->add_type_object("builtin_interfaces::msg::Time", builtin_interfaces::msg::GetTimeIdentifier(false), + builtin_interfaces::msg::GetTimeObject(false)); } -namespace std_msgs { +namespace builtin_interfaces { namespace msg { const TypeIdentifier* GetTimeIdentifier(bool complete) { @@ -83,7 +83,7 @@ namespace std_msgs { type_object->minimal().struct_type().struct_flags().IS_FINAL(false); type_object->minimal().struct_type().struct_flags().IS_APPENDABLE(false); type_object->minimal().struct_type().struct_flags().IS_MUTABLE(false); - type_object->minimal().struct_type().struct_flags().IS_NESTED(true); + type_object->minimal().struct_type().struct_flags().IS_NESTED(false); type_object->minimal().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported MemberId memberId = 0; @@ -171,7 +171,7 @@ namespace std_msgs { type_object->complete().struct_type().struct_flags().IS_FINAL(false); type_object->complete().struct_type().struct_flags().IS_APPENDABLE(false); type_object->complete().struct_type().struct_flags().IS_MUTABLE(false); - type_object->complete().struct_type().struct_flags().IS_NESTED(true); + type_object->complete().struct_type().struct_flags().IS_NESTED(false); type_object->complete().struct_type().struct_flags().IS_AUTOID_HASH(false); // Unsupported MemberId memberId = 0; @@ -188,6 +188,55 @@ namespace std_msgs { cst_sec.detail().name("sec"); + { + AppliedAnnotation ann; + //ann.annotation_typeid(GetverbatimIdentifier(true)); + ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("verbatim")); + { + AppliedAnnotationParameter annParam; + MD5 message_hash("language"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(TK_NONE); + paramValue.from_string("comment"); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + { + AppliedAnnotationParameter annParam; + MD5 message_hash("placement"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(EK_MINIMAL); + paramValue.from_string("1"); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + { + AppliedAnnotationParameter annParam; + MD5 message_hash("text"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(TK_NONE); + paramValue.from_string("The seconds component, valid over all int32 values."); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + cst_sec.detail().ann_custom().push_back(ann); + } + type_object->complete().struct_type().member_seq().emplace_back(cst_sec); CompleteStructMember cst_nanosec; @@ -203,6 +252,55 @@ namespace std_msgs { cst_nanosec.detail().name("nanosec"); + { + AppliedAnnotation ann; + //ann.annotation_typeid(GetverbatimIdentifier(true)); + ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("verbatim")); + { + AppliedAnnotationParameter annParam; + MD5 message_hash("language"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(TK_NONE); + paramValue.from_string("comment"); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + { + AppliedAnnotationParameter annParam; + MD5 message_hash("placement"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(EK_MINIMAL); + paramValue.from_string("1"); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + { + AppliedAnnotationParameter annParam; + MD5 message_hash("text"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(TK_NONE); + paramValue.from_string("The nanoseconds component, valid in the range [0, 10e9)."); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + cst_nanosec.detail().ann_custom().push_back(ann); + } + type_object->complete().struct_type().member_seq().emplace_back(cst_nanosec); @@ -212,18 +310,46 @@ namespace std_msgs { { AppliedAnnotation ann; - //ann.annotation_typeid(GetnestedIdentifier(true)); - ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("nested")); + //ann.annotation_typeid(GetverbatimIdentifier(true)); + ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("verbatim")); + { + AppliedAnnotationParameter annParam; + MD5 message_hash("language"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(TK_NONE); + paramValue.from_string("comment"); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + { + AppliedAnnotationParameter annParam; + MD5 message_hash("placement"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(EK_MINIMAL); + paramValue.from_string("1"); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + { AppliedAnnotationParameter annParam; - MD5 message_hash("value"); + MD5 message_hash("text"); for(int i = 0; i < 4; ++i) { annParam.paramname_hash()[i] = message_hash.digest[i]; } AnnotationParameterValue paramValue; - paramValue._d(TK_BOOLEAN); - paramValue.from_string("true"); + paramValue._d(TK_NONE); + paramValue.from_string("This message communicates ROS Time defined here:\nhttps://design.ros2.org/articles/clock_and_time.html"); annParam.value(paramValue); ann.param_seq().push_back(annParam); } @@ -260,4 +386,4 @@ namespace std_msgs { } } // namespace msg -} // namespace std_msgs \ No newline at end of file +} // namespace builtin_interfaces \ No newline at end of file diff --git a/third-party/realdds/src/topics/ros2/ros2timeTypeObject.h b/third-party/realdds/src/topics/ros2/builtin_interfaces/msg/TimeTypeObject.h similarity index 78% rename from third-party/realdds/src/topics/ros2/ros2timeTypeObject.h rename to third-party/realdds/src/topics/ros2/builtin_interfaces/msg/TimeTypeObject.h index 0bd0bd9e5b..d71d1cb10f 100644 --- a/third-party/realdds/src/topics/ros2/ros2timeTypeObject.h +++ b/third-party/realdds/src/topics/ros2/builtin_interfaces/msg/TimeTypeObject.h @@ -1,5 +1,5 @@ // License: Apache 2.0. See LICENSE file in root directory. -// Copyright(c) 2023 Intel Corporation. All Rights Reserved. +// Copyright(c) 2023-5 Intel Corporation. All Rights Reserved. /*! * @file TimeTypeObject.h @@ -8,8 +8,8 @@ * This file was generated by the tool gen. */ -#ifndef _FAST_DDS_GENERATED_STD_MSGS_MSG_TIME_TYPE_OBJECT_H_ -#define _FAST_DDS_GENERATED_STD_MSGS_MSG_TIME_TYPE_OBJECT_H_ +#ifndef _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_TIME_TYPE_OBJECT_H_ +#define _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_TIME_TYPE_OBJECT_H_ #include @@ -43,7 +43,7 @@ using namespace eprosima::fastrtps::types; eProsima_user_DllExport void registerTimeTypes(); -namespace std_msgs { +namespace builtin_interfaces { namespace msg { eProsima_user_DllExport const TypeIdentifier* GetTimeIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetTimeObject(bool complete = false); @@ -51,6 +51,6 @@ namespace std_msgs { eProsima_user_DllExport const TypeObject* GetCompleteTimeObject(); } // namespace msg -} // namespace std_msgs +} // namespace builtin_interfaces -#endif // _FAST_DDS_GENERATED_STD_MSGS_MSG_TIME_TYPE_OBJECT_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_BUILTIN_INTERFACES_MSG_TIME_TYPE_OBJECT_H_ \ No newline at end of file diff --git a/third-party/realdds/src/topics/ros2/ros2quaternion.cpp b/third-party/realdds/src/topics/ros2/geometry_msgs/msg/Quaternion.cpp similarity index 92% rename from third-party/realdds/src/topics/ros2/ros2quaternion.cpp rename to third-party/realdds/src/topics/ros2/geometry_msgs/msg/Quaternion.cpp index 3f81269ef1..e21dc2d260 100644 --- a/third-party/realdds/src/topics/ros2/ros2quaternion.cpp +++ b/third-party/realdds/src/topics/ros2/geometry_msgs/msg/Quaternion.cpp @@ -1,5 +1,5 @@ // License: Apache 2.0. See LICENSE file in root directory. -// Copyright(c) 2023 Intel Corporation. All Rights Reserved. +// Copyright(c) 2023-5 Intel Corporation. All Rights Reserved. /*! * @file Quaternion.cpp @@ -15,8 +15,8 @@ char dummy; } // namespace #endif // _WIN32 -#include -#include "ros2quaternionTypeObject.h" +#include +#include "QuaternionTypeObject.h" #include #include @@ -26,14 +26,14 @@ using namespace eprosima::fastcdr::exception; geometry_msgs::msg::Quaternion::Quaternion() { - // m_x com.eprosima.idl.parser.typecode.PrimitiveTypeCode@60704c + // m_x com.eprosima.idl.parser.typecode.PrimitiveTypeCode@71809907 m_x = 0.0; - // m_y com.eprosima.idl.parser.typecode.PrimitiveTypeCode@6b19b79 + // m_y com.eprosima.idl.parser.typecode.PrimitiveTypeCode@3ce1e309 m_y = 0.0; - // m_z com.eprosima.idl.parser.typecode.PrimitiveTypeCode@2a32de6c + // m_z com.eprosima.idl.parser.typecode.PrimitiveTypeCode@6aba2b86 m_z = 0.0; - // m_w com.eprosima.idl.parser.typecode.PrimitiveTypeCode@7692d9cc - m_w = 0.0; + // m_w com.eprosima.idl.parser.typecode.PrimitiveTypeCode@158da8e + m_w = 1.0; // Just to register all known types registerQuaternionTypes(); diff --git a/third-party/realdds/src/topics/ros2/ros2quaternionPubSubTypes.cpp b/third-party/realdds/src/topics/ros2/geometry_msgs/msg/QuaternionPubSubTypes.cpp similarity index 96% rename from third-party/realdds/src/topics/ros2/ros2quaternionPubSubTypes.cpp rename to third-party/realdds/src/topics/ros2/geometry_msgs/msg/QuaternionPubSubTypes.cpp index f88ab13452..b8740b2c63 100644 --- a/third-party/realdds/src/topics/ros2/ros2quaternionPubSubTypes.cpp +++ b/third-party/realdds/src/topics/ros2/geometry_msgs/msg/QuaternionPubSubTypes.cpp @@ -1,5 +1,5 @@ // License: Apache 2.0. See LICENSE file in root directory. -// Copyright(c) 2023 Intel Corporation. All Rights Reserved. +// Copyright(c) 2023-5 Intel Corporation. All Rights Reserved. /*! * @file QuaternionPubSubTypes.cpp @@ -12,7 +12,7 @@ #include #include -#include +#include using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; @@ -21,7 +21,7 @@ namespace geometry_msgs { namespace msg { QuaternionPubSubType::QuaternionPubSubType() { - setName("geometry_msgs::msg::Quaternion"); + setName("geometry_msgs::msg::dds_::Quaternion_"); auto type_size = Quaternion::getMaxCdrSerializedSize(); type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ diff --git a/third-party/realdds/src/topics/ros2/ros2quaternionTypeObject.cpp b/third-party/realdds/src/topics/ros2/geometry_msgs/msg/QuaternionTypeObject.cpp similarity index 69% rename from third-party/realdds/src/topics/ros2/ros2quaternionTypeObject.cpp rename to third-party/realdds/src/topics/ros2/geometry_msgs/msg/QuaternionTypeObject.cpp index e80a182f4e..29c7eaa282 100644 --- a/third-party/realdds/src/topics/ros2/ros2quaternionTypeObject.cpp +++ b/third-party/realdds/src/topics/ros2/geometry_msgs/msg/QuaternionTypeObject.cpp @@ -1,5 +1,5 @@ // License: Apache 2.0. See LICENSE file in root directory. -// Copyright(c) 2023 Intel Corporation. All Rights Reserved. +// Copyright(c) 2023-5 Intel Corporation. All Rights Reserved. /*! * @file QuaternionTypeObject.cpp @@ -13,8 +13,8 @@ namespace { char dummy; } #endif -#include -#include "ros2quaternionTypeObject.h" +#include +#include "QuaternionTypeObject.h" #include #include #include @@ -224,6 +224,27 @@ namespace geometry_msgs { cst_x.detail().name("x"); + { + AppliedAnnotation ann; + //ann.annotation_typeid(GetdefaultIdentifier(true)); + ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("default")); + { + AppliedAnnotationParameter annParam; + MD5 message_hash("value"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(); + paramValue.from_string("0.0"); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + cst_x.detail().ann_custom().push_back(ann); + } + type_object->complete().struct_type().member_seq().emplace_back(cst_x); CompleteStructMember cst_y; @@ -239,6 +260,27 @@ namespace geometry_msgs { cst_y.detail().name("y"); + { + AppliedAnnotation ann; + //ann.annotation_typeid(GetdefaultIdentifier(true)); + ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("default")); + { + AppliedAnnotationParameter annParam; + MD5 message_hash("value"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(); + paramValue.from_string("0.0"); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + cst_y.detail().ann_custom().push_back(ann); + } + type_object->complete().struct_type().member_seq().emplace_back(cst_y); CompleteStructMember cst_z; @@ -254,6 +296,27 @@ namespace geometry_msgs { cst_z.detail().name("z"); + { + AppliedAnnotation ann; + //ann.annotation_typeid(GetdefaultIdentifier(true)); + ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("default")); + { + AppliedAnnotationParameter annParam; + MD5 message_hash("value"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(); + paramValue.from_string("0.0"); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + cst_z.detail().ann_custom().push_back(ann); + } + type_object->complete().struct_type().member_seq().emplace_back(cst_z); CompleteStructMember cst_w; @@ -269,6 +332,27 @@ namespace geometry_msgs { cst_w.detail().name("w"); + { + AppliedAnnotation ann; + //ann.annotation_typeid(GetdefaultIdentifier(true)); + ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("default")); + { + AppliedAnnotationParameter annParam; + MD5 message_hash("value"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(); + paramValue.from_string("1.0"); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + cst_w.detail().ann_custom().push_back(ann); + } + type_object->complete().struct_type().member_seq().emplace_back(cst_w); @@ -276,6 +360,55 @@ namespace geometry_msgs { type_object->complete().struct_type().header().detail().type_name("Quaternion"); // TODO inheritance + { + AppliedAnnotation ann; + //ann.annotation_typeid(GetverbatimIdentifier(true)); + ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("verbatim")); + { + AppliedAnnotationParameter annParam; + MD5 message_hash("language"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(TK_NONE); + paramValue.from_string("comment"); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + { + AppliedAnnotationParameter annParam; + MD5 message_hash("placement"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(EK_MINIMAL); + paramValue.from_string("1"); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + { + AppliedAnnotationParameter annParam; + MD5 message_hash("text"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(TK_NONE); + paramValue.from_string("This represents an orientation in free space in quaternion form."); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + type_object->complete().struct_type().header().detail().ann_custom().push_back(ann); + } + TypeIdentifier identifier; identifier._d(EK_COMPLETE); diff --git a/third-party/realdds/src/topics/ros2/ros2quaternionTypeObject.h b/third-party/realdds/src/topics/ros2/geometry_msgs/msg/QuaternionTypeObject.h similarity index 100% rename from third-party/realdds/src/topics/ros2/ros2quaternionTypeObject.h rename to third-party/realdds/src/topics/ros2/geometry_msgs/msg/QuaternionTypeObject.h diff --git a/third-party/realdds/src/topics/ros2/ros2vector3.cpp b/third-party/realdds/src/topics/ros2/geometry_msgs/msg/Vector3.cpp similarity index 92% rename from third-party/realdds/src/topics/ros2/ros2vector3.cpp rename to third-party/realdds/src/topics/ros2/geometry_msgs/msg/Vector3.cpp index 211b607389..fd894a98f7 100644 --- a/third-party/realdds/src/topics/ros2/ros2vector3.cpp +++ b/third-party/realdds/src/topics/ros2/geometry_msgs/msg/Vector3.cpp @@ -1,5 +1,5 @@ // License: Apache 2.0. See LICENSE file in root directory. -// Copyright(c) 2023 Intel Corporation. All Rights Reserved. +// Copyright(c) 2023-5 Intel Corporation. All Rights Reserved. /*! * @file Vector3.cpp @@ -15,8 +15,8 @@ char dummy; } // namespace #endif // _WIN32 -#include -#include "ros2vector3TypeObject.h" +#include +#include "Vector3TypeObject.h" #include #include @@ -26,11 +26,11 @@ using namespace eprosima::fastcdr::exception; geometry_msgs::msg::Vector3::Vector3() { - // m_x com.eprosima.idl.parser.typecode.PrimitiveTypeCode@79ca92b9 + // m_x com.eprosima.idl.parser.typecode.PrimitiveTypeCode@7714e963 m_x = 0.0; - // m_y com.eprosima.idl.parser.typecode.PrimitiveTypeCode@1460a8c0 + // m_y com.eprosima.idl.parser.typecode.PrimitiveTypeCode@20ce78ec m_y = 0.0; - // m_z com.eprosima.idl.parser.typecode.PrimitiveTypeCode@4f638935 + // m_z com.eprosima.idl.parser.typecode.PrimitiveTypeCode@393671df m_z = 0.0; // Just to register all known types diff --git a/third-party/realdds/src/topics/ros2/ros2vector3PubSubTypes.cpp b/third-party/realdds/src/topics/ros2/geometry_msgs/msg/Vector3PubSubTypes.cpp similarity index 96% rename from third-party/realdds/src/topics/ros2/ros2vector3PubSubTypes.cpp rename to third-party/realdds/src/topics/ros2/geometry_msgs/msg/Vector3PubSubTypes.cpp index 7e6a56d636..8c309bb9d7 100644 --- a/third-party/realdds/src/topics/ros2/ros2vector3PubSubTypes.cpp +++ b/third-party/realdds/src/topics/ros2/geometry_msgs/msg/Vector3PubSubTypes.cpp @@ -1,5 +1,5 @@ // License: Apache 2.0. See LICENSE file in root directory. -// Copyright(c) 2023 Intel Corporation. All Rights Reserved. +// Copyright(c) 2023-5 Intel Corporation. All Rights Reserved. /*! * @file Vector3PubSubTypes.cpp @@ -12,7 +12,7 @@ #include #include -#include +#include using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; @@ -21,7 +21,7 @@ namespace geometry_msgs { namespace msg { Vector3PubSubType::Vector3PubSubType() { - setName("geometry_msgs::msg::Vector3"); + setName("geometry_msgs::msg::dds_::Vector3_"); auto type_size = Vector3::getMaxCdrSerializedSize(); type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ diff --git a/third-party/realdds/src/topics/ros2/ros2vector3TypeObject.cpp b/third-party/realdds/src/topics/ros2/geometry_msgs/msg/Vector3TypeObject.cpp similarity index 72% rename from third-party/realdds/src/topics/ros2/ros2vector3TypeObject.cpp rename to third-party/realdds/src/topics/ros2/geometry_msgs/msg/Vector3TypeObject.cpp index 2ea98fc2d3..d7bb16fd4d 100644 --- a/third-party/realdds/src/topics/ros2/ros2vector3TypeObject.cpp +++ b/third-party/realdds/src/topics/ros2/geometry_msgs/msg/Vector3TypeObject.cpp @@ -1,5 +1,5 @@ // License: Apache 2.0. See LICENSE file in root directory. -// Copyright(c) 2023 Intel Corporation. All Rights Reserved. +// Copyright(c) 2023-5 Intel Corporation. All Rights Reserved. /*! * @file Vector3TypeObject.cpp @@ -13,8 +13,8 @@ namespace { char dummy; } #endif -#include -#include "ros2vector3TypeObject.h" +#include +#include "Vector3TypeObject.h" #include #include #include @@ -206,6 +206,55 @@ namespace geometry_msgs { cst_x.detail().name("x"); + { + AppliedAnnotation ann; + //ann.annotation_typeid(GetverbatimIdentifier(true)); + ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("verbatim")); + { + AppliedAnnotationParameter annParam; + MD5 message_hash("language"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(TK_NONE); + paramValue.from_string("comment"); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + { + AppliedAnnotationParameter annParam; + MD5 message_hash("placement"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(EK_MINIMAL); + paramValue.from_string("1"); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + { + AppliedAnnotationParameter annParam; + MD5 message_hash("text"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(TK_NONE); + paramValue.from_string("This is semantically different than a point.\nA vector is always anchored at the origin.\nWhen a transform is applied to a vector, only the rotational component is applied."); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + cst_x.detail().ann_custom().push_back(ann); + } + type_object->complete().struct_type().member_seq().emplace_back(cst_x); CompleteStructMember cst_y; @@ -243,6 +292,55 @@ namespace geometry_msgs { type_object->complete().struct_type().header().detail().type_name("Vector3"); // TODO inheritance + { + AppliedAnnotation ann; + //ann.annotation_typeid(GetverbatimIdentifier(true)); + ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("verbatim")); + { + AppliedAnnotationParameter annParam; + MD5 message_hash("language"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(TK_NONE); + paramValue.from_string("comment"); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + { + AppliedAnnotationParameter annParam; + MD5 message_hash("placement"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(EK_MINIMAL); + paramValue.from_string("1"); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + { + AppliedAnnotationParameter annParam; + MD5 message_hash("text"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(TK_NONE); + paramValue.from_string("This represents a vector in free space."); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + type_object->complete().struct_type().header().detail().ann_custom().push_back(ann); + } + TypeIdentifier identifier; identifier._d(EK_COMPLETE); diff --git a/third-party/realdds/src/topics/ros2/ros2vector3TypeObject.h b/third-party/realdds/src/topics/ros2/geometry_msgs/msg/Vector3TypeObject.h similarity index 100% rename from third-party/realdds/src/topics/ros2/ros2vector3TypeObject.h rename to third-party/realdds/src/topics/ros2/geometry_msgs/msg/Vector3TypeObject.h diff --git a/third-party/realdds/src/topics/ros2/ros2image.cpp b/third-party/realdds/src/topics/ros2/sensor_msgs/msg/Image.cpp similarity index 97% rename from third-party/realdds/src/topics/ros2/ros2image.cpp rename to third-party/realdds/src/topics/ros2/sensor_msgs/msg/Image.cpp index 92e0156176..509b54de58 100644 --- a/third-party/realdds/src/topics/ros2/ros2image.cpp +++ b/third-party/realdds/src/topics/ros2/sensor_msgs/msg/Image.cpp @@ -1,5 +1,5 @@ // License: Apache 2.0. See LICENSE file in root directory. -// Copyright(c) 2023 Intel Corporation. All Rights Reserved. +// Copyright(c) 2023-5 Intel Corporation. All Rights Reserved. /*! * @file Image.cpp @@ -15,8 +15,8 @@ char dummy; } // namespace #endif // _WIN32 -#include -#include "ros2imageTypeObject.h" +#include +#include "ImageTypeObject.h" #include #include @@ -26,19 +26,19 @@ using namespace eprosima::fastcdr::exception; sensor_msgs::msg::Image::Image() { - // m_header com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@229d10bd + // m_header com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@1a04f701 - // m_height com.eprosima.idl.parser.typecode.PrimitiveTypeCode@47542153 + // m_height com.eprosima.idl.parser.typecode.PrimitiveTypeCode@4e91d63f m_height = 0; - // m_width com.eprosima.idl.parser.typecode.PrimitiveTypeCode@33afa13b + // m_width com.eprosima.idl.parser.typecode.PrimitiveTypeCode@d4342c2 m_width = 0; - // m_encoding com.eprosima.idl.parser.typecode.StringTypeCode@7a4ccb53 + // m_encoding com.eprosima.idl.parser.typecode.StringTypeCode@2bbf180e m_encoding =""; - // m_is_bigendian com.eprosima.idl.parser.typecode.PrimitiveTypeCode@309e345f + // m_is_bigendian com.eprosima.idl.parser.typecode.PrimitiveTypeCode@163e4e87 m_is_bigendian = 0; - // m_step com.eprosima.idl.parser.typecode.PrimitiveTypeCode@56a6d5a6 + // m_step com.eprosima.idl.parser.typecode.PrimitiveTypeCode@56de5251 m_step = 0; - // m_data com.eprosima.idl.parser.typecode.SequenceTypeCode@18ce0030 + // m_data com.eprosima.idl.parser.typecode.SequenceTypeCode@419c5f1a // Just to register all known types diff --git a/third-party/realdds/src/topics/ros2/ros2imagePubSubTypes.cpp b/third-party/realdds/src/topics/ros2/sensor_msgs/msg/ImagePubSubTypes.cpp similarity index 97% rename from third-party/realdds/src/topics/ros2/ros2imagePubSubTypes.cpp rename to third-party/realdds/src/topics/ros2/sensor_msgs/msg/ImagePubSubTypes.cpp index 043e49b8a2..354511d6b6 100644 --- a/third-party/realdds/src/topics/ros2/ros2imagePubSubTypes.cpp +++ b/third-party/realdds/src/topics/ros2/sensor_msgs/msg/ImagePubSubTypes.cpp @@ -1,5 +1,5 @@ // License: Apache 2.0. See LICENSE file in root directory. -// Copyright(c) 2023 Intel Corporation. All Rights Reserved. +// Copyright(c) 2023-5 Intel Corporation. All Rights Reserved. /*! * @file ImagePubSubTypes.cpp @@ -12,7 +12,7 @@ #include #include -#include +#include using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; diff --git a/third-party/realdds/src/topics/ros2/ros2imageTypeObject.cpp b/third-party/realdds/src/topics/ros2/sensor_msgs/msg/ImageTypeObject.cpp similarity index 51% rename from third-party/realdds/src/topics/ros2/ros2imageTypeObject.cpp rename to third-party/realdds/src/topics/ros2/sensor_msgs/msg/ImageTypeObject.cpp index 78af19ebbe..7cf1033bfc 100644 --- a/third-party/realdds/src/topics/ros2/ros2imageTypeObject.cpp +++ b/third-party/realdds/src/topics/ros2/sensor_msgs/msg/ImageTypeObject.cpp @@ -1,5 +1,5 @@ // License: Apache 2.0. See LICENSE file in root directory. -// Copyright(c) 2023 Intel Corporation. All Rights Reserved. +// Copyright(c) 2023-5 Intel Corporation. All Rights Reserved. /*! * @file ImageTypeObject.cpp @@ -13,8 +13,8 @@ namespace { char dummy; } #endif -#include -#include "ros2imageTypeObject.h" +#include +#include "ImageTypeObject.h" #include #include #include @@ -30,10 +30,10 @@ using namespace eprosima::fastrtps::rtps; void registerImageTypes() { TypeObjectFactory *factory = TypeObjectFactory::get_instance(); - factory->add_type_object("std_msgs::msg::Time", std_msgs::msg::GetTimeIdentifier(true), - std_msgs::msg::GetTimeObject(true)); - factory->add_type_object("std_msgs::msg::Time", std_msgs::msg::GetTimeIdentifier(false), - std_msgs::msg::GetTimeObject(false)); + factory->add_type_object("builtin_interfaces::msg::Time", builtin_interfaces::msg::GetTimeIdentifier(true), + builtin_interfaces::msg::GetTimeObject(true)); + factory->add_type_object("builtin_interfaces::msg::Time", builtin_interfaces::msg::GetTimeIdentifier(false), + builtin_interfaces::msg::GetTimeObject(false)); @@ -44,9 +44,9 @@ void registerImageTypes() - factory->add_type_object("sensor_msgs::msg::dds_::Image_", sensor_msgs::msg::GetImageIdentifier(true), + factory->add_type_object("sensor_msgs::msg::Image", sensor_msgs::msg::GetImageIdentifier(true), sensor_msgs::msg::GetImageObject(true)); - factory->add_type_object("sensor_msgs::msg::dds_::Image_", sensor_msgs::msg::GetImageIdentifier(false), + factory->add_type_object("sensor_msgs::msg::Image", sensor_msgs::msg::GetImageIdentifier(false), sensor_msgs::msg::GetImageObject(false)); @@ -292,6 +292,55 @@ namespace sensor_msgs { cst_header.common().member_type_id(*std_msgs::msg::GetHeaderIdentifier(true)); cst_header.detail().name("header"); + { + AppliedAnnotation ann; + //ann.annotation_typeid(GetverbatimIdentifier(true)); + ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("verbatim")); + { + AppliedAnnotationParameter annParam; + MD5 message_hash("language"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(TK_NONE); + paramValue.from_string("comment"); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + { + AppliedAnnotationParameter annParam; + MD5 message_hash("placement"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(EK_MINIMAL); + paramValue.from_string("1"); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + { + AppliedAnnotationParameter annParam; + MD5 message_hash("text"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(TK_NONE); + paramValue.from_string("Header timestamp should be acquisition time of image\nHeader frame_id should be optical frame of camera\norigin of frame should be optical center of cameara\n+x should point to the right in the image\n+y should point down in the image\n+z should point into to plane of the image\nIf the frame_id here and the frame_id of the CameraInfo\nmessage associated with the image conflict\nthe behavior is undefined"); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + cst_header.detail().ann_custom().push_back(ann); + } + type_object->complete().struct_type().member_seq().emplace_back(cst_header); CompleteStructMember cst_height; @@ -307,6 +356,55 @@ namespace sensor_msgs { cst_height.detail().name("height"); + { + AppliedAnnotation ann; + //ann.annotation_typeid(GetverbatimIdentifier(true)); + ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("verbatim")); + { + AppliedAnnotationParameter annParam; + MD5 message_hash("language"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(TK_NONE); + paramValue.from_string("comment"); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + { + AppliedAnnotationParameter annParam; + MD5 message_hash("placement"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(EK_MINIMAL); + paramValue.from_string("1"); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + { + AppliedAnnotationParameter annParam; + MD5 message_hash("text"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(TK_NONE); + paramValue.from_string("image height, that is, number of rows"); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + cst_height.detail().ann_custom().push_back(ann); + } + type_object->complete().struct_type().member_seq().emplace_back(cst_height); CompleteStructMember cst_width; @@ -322,6 +420,55 @@ namespace sensor_msgs { cst_width.detail().name("width"); + { + AppliedAnnotation ann; + //ann.annotation_typeid(GetverbatimIdentifier(true)); + ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("verbatim")); + { + AppliedAnnotationParameter annParam; + MD5 message_hash("language"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(TK_NONE); + paramValue.from_string("comment"); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + { + AppliedAnnotationParameter annParam; + MD5 message_hash("placement"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(EK_MINIMAL); + paramValue.from_string("1"); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + { + AppliedAnnotationParameter annParam; + MD5 message_hash("text"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(TK_NONE); + paramValue.from_string("image width, that is, number of columns"); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + cst_width.detail().ann_custom().push_back(ann); + } + type_object->complete().struct_type().member_seq().emplace_back(cst_width); CompleteStructMember cst_encoding; @@ -338,6 +485,55 @@ namespace sensor_msgs { cst_encoding.detail().name("encoding"); + { + AppliedAnnotation ann; + //ann.annotation_typeid(GetverbatimIdentifier(true)); + ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("verbatim")); + { + AppliedAnnotationParameter annParam; + MD5 message_hash("language"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(TK_NONE); + paramValue.from_string("comment"); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + { + AppliedAnnotationParameter annParam; + MD5 message_hash("placement"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(EK_MINIMAL); + paramValue.from_string("1"); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + { + AppliedAnnotationParameter annParam; + MD5 message_hash("text"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(TK_NONE); + paramValue.from_string("The legal values for encoding are in file src/image_encodings.cpp\nIf you want to standardize a new string format, join\nros-users@lists.ros.org and send an email proposing a new encoding.\nEncoding of pixels -- channel meaning, ordering, size\ntaken from the list of strings in include/sensor_msgs/image_encodings.hpp"); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + cst_encoding.detail().ann_custom().push_back(ann); + } + type_object->complete().struct_type().member_seq().emplace_back(cst_encoding); CompleteStructMember cst_is_bigendian; @@ -353,6 +549,55 @@ namespace sensor_msgs { cst_is_bigendian.detail().name("is_bigendian"); + { + AppliedAnnotation ann; + //ann.annotation_typeid(GetverbatimIdentifier(true)); + ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("verbatim")); + { + AppliedAnnotationParameter annParam; + MD5 message_hash("language"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(TK_NONE); + paramValue.from_string("comment"); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + { + AppliedAnnotationParameter annParam; + MD5 message_hash("placement"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(EK_MINIMAL); + paramValue.from_string("1"); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + { + AppliedAnnotationParameter annParam; + MD5 message_hash("text"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(TK_NONE); + paramValue.from_string("is this data bigendian?"); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + cst_is_bigendian.detail().ann_custom().push_back(ann); + } + type_object->complete().struct_type().member_seq().emplace_back(cst_is_bigendian); CompleteStructMember cst_step; @@ -368,6 +613,55 @@ namespace sensor_msgs { cst_step.detail().name("step"); + { + AppliedAnnotation ann; + //ann.annotation_typeid(GetverbatimIdentifier(true)); + ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("verbatim")); + { + AppliedAnnotationParameter annParam; + MD5 message_hash("language"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(TK_NONE); + paramValue.from_string("comment"); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + { + AppliedAnnotationParameter annParam; + MD5 message_hash("placement"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(EK_MINIMAL); + paramValue.from_string("1"); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + { + AppliedAnnotationParameter annParam; + MD5 message_hash("text"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(TK_NONE); + paramValue.from_string("Full row length in bytes"); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + cst_step.detail().ann_custom().push_back(ann); + } + type_object->complete().struct_type().member_seq().emplace_back(cst_step); CompleteStructMember cst_data; @@ -384,6 +678,55 @@ namespace sensor_msgs { cst_data.detail().name("data"); + { + AppliedAnnotation ann; + //ann.annotation_typeid(GetverbatimIdentifier(true)); + ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("verbatim")); + { + AppliedAnnotationParameter annParam; + MD5 message_hash("language"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(TK_NONE); + paramValue.from_string("comment"); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + { + AppliedAnnotationParameter annParam; + MD5 message_hash("placement"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(EK_MINIMAL); + paramValue.from_string("1"); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + { + AppliedAnnotationParameter annParam; + MD5 message_hash("text"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(TK_NONE); + paramValue.from_string("actual matrix data, size is (step * rows)"); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + cst_data.detail().ann_custom().push_back(ann); + } + type_object->complete().struct_type().member_seq().emplace_back(cst_data); @@ -391,6 +734,55 @@ namespace sensor_msgs { type_object->complete().struct_type().header().detail().type_name("Image"); // TODO inheritance + { + AppliedAnnotation ann; + //ann.annotation_typeid(GetverbatimIdentifier(true)); + ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("verbatim")); + { + AppliedAnnotationParameter annParam; + MD5 message_hash("language"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(TK_NONE); + paramValue.from_string("comment"); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + { + AppliedAnnotationParameter annParam; + MD5 message_hash("placement"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(EK_MINIMAL); + paramValue.from_string("1"); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + { + AppliedAnnotationParameter annParam; + MD5 message_hash("text"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(TK_NONE); + paramValue.from_string("This message contains an uncompressed image\n(0, 0) is at top-left corner of image"); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + type_object->complete().struct_type().header().detail().ann_custom().push_back(ann); + } + TypeIdentifier identifier; identifier._d(EK_COMPLETE); @@ -420,4 +812,4 @@ namespace sensor_msgs { } } // namespace msg -} // namespace sensor_msgs +} // namespace sensor_msgs \ No newline at end of file diff --git a/third-party/realdds/src/topics/ros2/ros2imageTypeObject.h b/third-party/realdds/src/topics/ros2/sensor_msgs/msg/ImageTypeObject.h similarity index 93% rename from third-party/realdds/src/topics/ros2/ros2imageTypeObject.h rename to third-party/realdds/src/topics/ros2/sensor_msgs/msg/ImageTypeObject.h index e6116321d1..2264bf545e 100644 --- a/third-party/realdds/src/topics/ros2/ros2imageTypeObject.h +++ b/third-party/realdds/src/topics/ros2/sensor_msgs/msg/ImageTypeObject.h @@ -1,5 +1,5 @@ // License: Apache 2.0. See LICENSE file in root directory. -// Copyright(c) 2023 Intel Corporation. All Rights Reserved. +// Copyright(c) 2023-5 Intel Corporation. All Rights Reserved. /*! * @file ImageTypeObject.h @@ -11,7 +11,7 @@ #ifndef _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_IMAGE_TYPE_OBJECT_H_ #define _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_IMAGE_TYPE_OBJECT_H_ -#include "ros2headerTypeObject.h" +#include "../../std_msgs/msg/HeaderTypeObject.h" #include #include diff --git a/third-party/realdds/src/topics/ros2/ros2imu.cpp b/third-party/realdds/src/topics/ros2/sensor_msgs/msg/Imu.cpp similarity index 90% rename from third-party/realdds/src/topics/ros2/ros2imu.cpp rename to third-party/realdds/src/topics/ros2/sensor_msgs/msg/Imu.cpp index 674b1dab24..cc82488f73 100644 --- a/third-party/realdds/src/topics/ros2/ros2imu.cpp +++ b/third-party/realdds/src/topics/ros2/sensor_msgs/msg/Imu.cpp @@ -1,5 +1,5 @@ // License: Apache 2.0. See LICENSE file in root directory. -// Copyright(c) 2023 Intel Corporation. All Rights Reserved. +// Copyright(c) 2023-5 Intel Corporation. All Rights Reserved. /*! * @file Imu.cpp @@ -15,8 +15,8 @@ char dummy; } // namespace #endif // _WIN32 -#include -#include "ros2imuTypeObject.h" +#include +#include "ImuTypeObject.h" #include #include @@ -27,19 +27,19 @@ using namespace eprosima::fastcdr::exception; sensor_msgs::msg::Imu::Imu() { - // m_header com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@62e136d3 + // m_header com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@48aaecc3 - // m_orientation com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@c8e4bb0 + // m_orientation com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@7c0c77c7 - // m_orientation_covariance com.eprosima.idl.parser.typecode.AliasTypeCode@6279cee3 + // m_orientation_covariance com.eprosima.idl.parser.typecode.AliasTypeCode@7adda9cc memset(&m_orientation_covariance, 0, (9) * 8); - // m_angular_velocity com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@4206a205 + // m_angular_velocity com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@5cee5251 - // m_angular_velocity_covariance com.eprosima.idl.parser.typecode.AliasTypeCode@6279cee3 + // m_angular_velocity_covariance com.eprosima.idl.parser.typecode.AliasTypeCode@7adda9cc memset(&m_angular_velocity_covariance, 0, (9) * 8); - // m_linear_acceleration com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@4206a205 + // m_linear_acceleration com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@5cee5251 - // m_linear_acceleration_covariance com.eprosima.idl.parser.typecode.AliasTypeCode@6279cee3 + // m_linear_acceleration_covariance com.eprosima.idl.parser.typecode.AliasTypeCode@7adda9cc memset(&m_linear_acceleration_covariance, 0, (9) * 8); // Just to register all known types @@ -290,7 +290,7 @@ geometry_msgs::msg::Quaternion& sensor_msgs::msg::Imu::orientation() * @param _orientation_covariance New value to be copied in member orientation_covariance */ void sensor_msgs::msg::Imu::orientation_covariance( - const sensor_msgs::msg::sensor_msgs__Imu__double_array_9& _orientation_covariance) + const sensor_msgs::msg::double__9& _orientation_covariance) { m_orientation_covariance = _orientation_covariance; } @@ -300,7 +300,7 @@ void sensor_msgs::msg::Imu::orientation_covariance( * @param _orientation_covariance New value to be moved in member orientation_covariance */ void sensor_msgs::msg::Imu::orientation_covariance( - sensor_msgs::msg::sensor_msgs__Imu__double_array_9&& _orientation_covariance) + sensor_msgs::msg::double__9&& _orientation_covariance) { m_orientation_covariance = std::move(_orientation_covariance); } @@ -309,7 +309,7 @@ void sensor_msgs::msg::Imu::orientation_covariance( * @brief This function returns a constant reference to member orientation_covariance * @return Constant reference to member orientation_covariance */ -const sensor_msgs::msg::sensor_msgs__Imu__double_array_9& sensor_msgs::msg::Imu::orientation_covariance() const +const sensor_msgs::msg::double__9& sensor_msgs::msg::Imu::orientation_covariance() const { return m_orientation_covariance; } @@ -318,7 +318,7 @@ const sensor_msgs::msg::sensor_msgs__Imu__double_array_9& sensor_msgs::msg::Imu: * @brief This function returns a reference to member orientation_covariance * @return Reference to member orientation_covariance */ -sensor_msgs::msg::sensor_msgs__Imu__double_array_9& sensor_msgs::msg::Imu::orientation_covariance() +sensor_msgs::msg::double__9& sensor_msgs::msg::Imu::orientation_covariance() { return m_orientation_covariance; } @@ -364,7 +364,7 @@ geometry_msgs::msg::Vector3& sensor_msgs::msg::Imu::angular_velocity() * @param _angular_velocity_covariance New value to be copied in member angular_velocity_covariance */ void sensor_msgs::msg::Imu::angular_velocity_covariance( - const sensor_msgs::msg::sensor_msgs__Imu__double_array_9& _angular_velocity_covariance) + const sensor_msgs::msg::double__9& _angular_velocity_covariance) { m_angular_velocity_covariance = _angular_velocity_covariance; } @@ -374,7 +374,7 @@ void sensor_msgs::msg::Imu::angular_velocity_covariance( * @param _angular_velocity_covariance New value to be moved in member angular_velocity_covariance */ void sensor_msgs::msg::Imu::angular_velocity_covariance( - sensor_msgs::msg::sensor_msgs__Imu__double_array_9&& _angular_velocity_covariance) + sensor_msgs::msg::double__9&& _angular_velocity_covariance) { m_angular_velocity_covariance = std::move(_angular_velocity_covariance); } @@ -383,7 +383,7 @@ void sensor_msgs::msg::Imu::angular_velocity_covariance( * @brief This function returns a constant reference to member angular_velocity_covariance * @return Constant reference to member angular_velocity_covariance */ -const sensor_msgs::msg::sensor_msgs__Imu__double_array_9& sensor_msgs::msg::Imu::angular_velocity_covariance() const +const sensor_msgs::msg::double__9& sensor_msgs::msg::Imu::angular_velocity_covariance() const { return m_angular_velocity_covariance; } @@ -392,7 +392,7 @@ const sensor_msgs::msg::sensor_msgs__Imu__double_array_9& sensor_msgs::msg::Imu: * @brief This function returns a reference to member angular_velocity_covariance * @return Reference to member angular_velocity_covariance */ -sensor_msgs::msg::sensor_msgs__Imu__double_array_9& sensor_msgs::msg::Imu::angular_velocity_covariance() +sensor_msgs::msg::double__9& sensor_msgs::msg::Imu::angular_velocity_covariance() { return m_angular_velocity_covariance; } @@ -438,7 +438,7 @@ geometry_msgs::msg::Vector3& sensor_msgs::msg::Imu::linear_acceleration() * @param _linear_acceleration_covariance New value to be copied in member linear_acceleration_covariance */ void sensor_msgs::msg::Imu::linear_acceleration_covariance( - const sensor_msgs::msg::sensor_msgs__Imu__double_array_9& _linear_acceleration_covariance) + const sensor_msgs::msg::double__9& _linear_acceleration_covariance) { m_linear_acceleration_covariance = _linear_acceleration_covariance; } @@ -448,7 +448,7 @@ void sensor_msgs::msg::Imu::linear_acceleration_covariance( * @param _linear_acceleration_covariance New value to be moved in member linear_acceleration_covariance */ void sensor_msgs::msg::Imu::linear_acceleration_covariance( - sensor_msgs::msg::sensor_msgs__Imu__double_array_9&& _linear_acceleration_covariance) + sensor_msgs::msg::double__9&& _linear_acceleration_covariance) { m_linear_acceleration_covariance = std::move(_linear_acceleration_covariance); } @@ -457,7 +457,7 @@ void sensor_msgs::msg::Imu::linear_acceleration_covariance( * @brief This function returns a constant reference to member linear_acceleration_covariance * @return Constant reference to member linear_acceleration_covariance */ -const sensor_msgs::msg::sensor_msgs__Imu__double_array_9& sensor_msgs::msg::Imu::linear_acceleration_covariance() const +const sensor_msgs::msg::double__9& sensor_msgs::msg::Imu::linear_acceleration_covariance() const { return m_linear_acceleration_covariance; } @@ -466,7 +466,7 @@ const sensor_msgs::msg::sensor_msgs__Imu__double_array_9& sensor_msgs::msg::Imu: * @brief This function returns a reference to member linear_acceleration_covariance * @return Reference to member linear_acceleration_covariance */ -sensor_msgs::msg::sensor_msgs__Imu__double_array_9& sensor_msgs::msg::Imu::linear_acceleration_covariance() +sensor_msgs::msg::double__9& sensor_msgs::msg::Imu::linear_acceleration_covariance() { return m_linear_acceleration_covariance; } diff --git a/third-party/realdds/src/topics/ros2/ros2imuPubSubTypes.cpp b/third-party/realdds/src/topics/ros2/sensor_msgs/msg/ImuPubSubTypes.cpp similarity index 97% rename from third-party/realdds/src/topics/ros2/ros2imuPubSubTypes.cpp rename to third-party/realdds/src/topics/ros2/sensor_msgs/msg/ImuPubSubTypes.cpp index f7a551799d..7779a88827 100644 --- a/third-party/realdds/src/topics/ros2/ros2imuPubSubTypes.cpp +++ b/third-party/realdds/src/topics/ros2/sensor_msgs/msg/ImuPubSubTypes.cpp @@ -1,5 +1,5 @@ // License: Apache 2.0. See LICENSE file in root directory. -// Copyright(c) 2023 Intel Corporation. All Rights Reserved. +// Copyright(c) 2023-5 Intel Corporation. All Rights Reserved. /*! * @file ImuPubSubTypes.cpp @@ -12,7 +12,7 @@ #include #include -#include +#include using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; diff --git a/third-party/realdds/src/topics/ros2/ros2imuTypeObject.cpp b/third-party/realdds/src/topics/ros2/sensor_msgs/msg/ImuTypeObject.cpp similarity index 72% rename from third-party/realdds/src/topics/ros2/ros2imuTypeObject.cpp rename to third-party/realdds/src/topics/ros2/sensor_msgs/msg/ImuTypeObject.cpp index 260c4e4859..05775128b2 100644 --- a/third-party/realdds/src/topics/ros2/ros2imuTypeObject.cpp +++ b/third-party/realdds/src/topics/ros2/sensor_msgs/msg/ImuTypeObject.cpp @@ -1,5 +1,5 @@ // License: Apache 2.0. See LICENSE file in root directory. -// Copyright(c) 2023 Intel Corporation. All Rights Reserved. +// Copyright(c) 2023-5 Intel Corporation. All Rights Reserved. /*! * @file ImuTypeObject.cpp @@ -13,8 +13,8 @@ namespace { char dummy; } #endif -#include -#include "ros2imuTypeObject.h" +#include +#include "ImuTypeObject.h" #include #include #include @@ -44,10 +44,10 @@ void registerImuTypes() - factory->add_type_object("std_msgs::msg::Time", std_msgs::msg::GetTimeIdentifier(true), - std_msgs::msg::GetTimeObject(true)); - factory->add_type_object("std_msgs::msg::Time", std_msgs::msg::GetTimeIdentifier(false), - std_msgs::msg::GetTimeObject(false)); + factory->add_type_object("builtin_interfaces::msg::Time", builtin_interfaces::msg::GetTimeIdentifier(true), + builtin_interfaces::msg::GetTimeObject(true)); + factory->add_type_object("builtin_interfaces::msg::Time", builtin_interfaces::msg::GetTimeIdentifier(false), + builtin_interfaces::msg::GetTimeObject(false)); @@ -58,10 +58,10 @@ void registerImuTypes() - factory->add_type_object("sensor_msgs::msg::sensor_msgs__Imu__double_array_9", sensor_msgs::msg::Getsensor_msgs__Imu__double_array_9Identifier(true), - sensor_msgs::msg::Getsensor_msgs__Imu__double_array_9Object(true)); - factory->add_type_object("sensor_msgs::msg::sensor_msgs__Imu__double_array_9", sensor_msgs::msg::Getsensor_msgs__Imu__double_array_9Identifier(false), - sensor_msgs::msg::Getsensor_msgs__Imu__double_array_9Object(false)); + factory->add_type_object("sensor_msgs::msg::double__9", sensor_msgs::msg::Getdouble__9Identifier(true), + sensor_msgs::msg::Getdouble__9Object(true)); + factory->add_type_object("sensor_msgs::msg::double__9", sensor_msgs::msg::Getdouble__9Identifier(false), + sensor_msgs::msg::Getdouble__9Object(false)); factory->add_type_object("sensor_msgs::msg::Imu", sensor_msgs::msg::GetImuIdentifier(true), sensor_msgs::msg::GetImuObject(true)); @@ -74,38 +74,38 @@ void registerImuTypes() namespace sensor_msgs { namespace msg { - const TypeIdentifier* Getsensor_msgs__Imu__double_array_9Identifier(bool complete) + const TypeIdentifier* Getdouble__9Identifier(bool complete) { - const TypeIdentifier* c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("sensor_msgs__Imu__double_array_9", complete); + const TypeIdentifier* c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("double__9", complete); if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE)) { return c_identifier; } - Getsensor_msgs__Imu__double_array_9Object(complete); // Generated inside - return TypeObjectFactory::get_instance()->get_type_identifier("sensor_msgs__Imu__double_array_9", complete); + Getdouble__9Object(complete); // Generated inside + return TypeObjectFactory::get_instance()->get_type_identifier("double__9", complete); } - const TypeObject* Getsensor_msgs__Imu__double_array_9Object(bool complete) + const TypeObject* Getdouble__9Object(bool complete) { - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("sensor_msgs__Imu__double_array_9", complete); + const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("double__9", complete); if (c_type_object != nullptr) { return c_type_object; } else if (complete) { - return GetCompletesensor_msgs__Imu__double_array_9Object(); + return GetCompletedouble__9Object(); } else { - return GetMinimalsensor_msgs__Imu__double_array_9Object(); + return GetMinimaldouble__9Object(); } } - const TypeObject* GetMinimalsensor_msgs__Imu__double_array_9Object() + const TypeObject* GetMinimaldouble__9Object() { - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("sensor_msgs__Imu__double_array_9", false); + const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("double__9", false); if (c_type_object != nullptr) { return c_type_object; @@ -171,16 +171,16 @@ namespace sensor_msgs { } // Don't add our TypeIdentifier but our alias - TypeObjectFactory::get_instance()->add_alias("sensor_msgs__Imu__double_array_9", TypeNamesGenerator::get_array_type_name("double", {9})); + TypeObjectFactory::get_instance()->add_alias("double__9", TypeNamesGenerator::get_array_type_name("double", {9})); - TypeObjectFactory::get_instance()->add_type_object("sensor_msgs__Imu__double_array_9", &identifier, type_object); + TypeObjectFactory::get_instance()->add_type_object("double__9", &identifier, type_object); delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("sensor_msgs__Imu__double_array_9", false); + return TypeObjectFactory::get_instance()->get_type_object("double__9", false); } - const TypeObject* GetCompletesensor_msgs__Imu__double_array_9Object() + const TypeObject* GetCompletedouble__9Object() { - const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("sensor_msgs__Imu__double_array_9", true); + const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("double__9", true); if (c_type_object != nullptr && c_type_object->_d() == EK_COMPLETE) { return c_type_object; @@ -201,7 +201,7 @@ namespace sensor_msgs { //type_object->complete().alias_type().header().detail().ann_builtin().verbatim().language("language"); //type_object->complete().alias_type().header().detail().ann_builtin().verbatim().text("text"); //type_object->complete().alias_type().header().detail().ann_custom().push_back(...); - type_object->complete().alias_type().header().detail().type_name("sensor_msgs__Imu__double_array_9"); + type_object->complete().alias_type().header().detail().type_name("double__9"); // No flags apply //type_object->complete().alias_type().body().common().related_flags().TRY_CONSTRUCT1(false); @@ -253,11 +253,11 @@ namespace sensor_msgs { } // Don't add our TypeIdentifier but our alias - TypeObjectFactory::get_instance()->add_alias("sensor_msgs__Imu__double_array_9", TypeNamesGenerator::get_array_type_name("double", {9})); + TypeObjectFactory::get_instance()->add_alias("double__9", TypeNamesGenerator::get_array_type_name("double", {9})); - TypeObjectFactory::get_instance()->add_type_object("sensor_msgs__Imu__double_array_9", &identifier, type_object); + TypeObjectFactory::get_instance()->add_type_object("double__9", &identifier, type_object); delete type_object; - return TypeObjectFactory::get_instance()->get_type_object("sensor_msgs__Imu__double_array_9", true); + return TypeObjectFactory::get_instance()->get_type_object("double__9", true); } const TypeIdentifier* GetImuIdentifier(bool complete) @@ -349,7 +349,7 @@ namespace sensor_msgs { mst_orientation_covariance.common().member_flags().IS_MUST_UNDERSTAND(false); mst_orientation_covariance.common().member_flags().IS_KEY(false); mst_orientation_covariance.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_orientation_covariance.common().member_type_id(*sensor_msgs::msg::Getsensor_msgs__Imu__double_array_9Identifier(false)); + mst_orientation_covariance.common().member_type_id(*sensor_msgs::msg::Getdouble__9Identifier(false)); MD5 orientation_covariance_hash("orientation_covariance"); for(int i = 0; i < 4; ++i) { @@ -383,7 +383,7 @@ namespace sensor_msgs { mst_angular_velocity_covariance.common().member_flags().IS_MUST_UNDERSTAND(false); mst_angular_velocity_covariance.common().member_flags().IS_KEY(false); mst_angular_velocity_covariance.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_angular_velocity_covariance.common().member_type_id(*sensor_msgs::msg::Getsensor_msgs__Imu__double_array_9Identifier(false)); + mst_angular_velocity_covariance.common().member_type_id(*sensor_msgs::msg::Getdouble__9Identifier(false)); MD5 angular_velocity_covariance_hash("angular_velocity_covariance"); for(int i = 0; i < 4; ++i) { @@ -417,7 +417,7 @@ namespace sensor_msgs { mst_linear_acceleration_covariance.common().member_flags().IS_MUST_UNDERSTAND(false); mst_linear_acceleration_covariance.common().member_flags().IS_KEY(false); mst_linear_acceleration_covariance.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_linear_acceleration_covariance.common().member_type_id(*sensor_msgs::msg::Getsensor_msgs__Imu__double_array_9Identifier(false)); + mst_linear_acceleration_covariance.common().member_type_id(*sensor_msgs::msg::Getdouble__9Identifier(false)); MD5 linear_acceleration_covariance_hash("linear_acceleration_covariance"); for(int i = 0; i < 4; ++i) { @@ -514,9 +514,58 @@ namespace sensor_msgs { cst_orientation_covariance.common().member_flags().IS_MUST_UNDERSTAND(false); cst_orientation_covariance.common().member_flags().IS_KEY(false); cst_orientation_covariance.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_orientation_covariance.common().member_type_id(*sensor_msgs::msg::Getsensor_msgs__Imu__double_array_9Identifier(true)); + cst_orientation_covariance.common().member_type_id(*sensor_msgs::msg::Getdouble__9Identifier(true)); cst_orientation_covariance.detail().name("orientation_covariance"); + { + AppliedAnnotation ann; + //ann.annotation_typeid(GetverbatimIdentifier(true)); + ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("verbatim")); + { + AppliedAnnotationParameter annParam; + MD5 message_hash("language"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(TK_NONE); + paramValue.from_string("comment"); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + { + AppliedAnnotationParameter annParam; + MD5 message_hash("placement"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(EK_MINIMAL); + paramValue.from_string("1"); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + { + AppliedAnnotationParameter annParam; + MD5 message_hash("text"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(TK_NONE); + paramValue.from_string("Row major about x, y, z axes"); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + cst_orientation_covariance.detail().ann_custom().push_back(ann); + } + type_object->complete().struct_type().member_seq().emplace_back(cst_orientation_covariance); CompleteStructMember cst_angular_velocity; @@ -542,9 +591,58 @@ namespace sensor_msgs { cst_angular_velocity_covariance.common().member_flags().IS_MUST_UNDERSTAND(false); cst_angular_velocity_covariance.common().member_flags().IS_KEY(false); cst_angular_velocity_covariance.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_angular_velocity_covariance.common().member_type_id(*sensor_msgs::msg::Getsensor_msgs__Imu__double_array_9Identifier(true)); + cst_angular_velocity_covariance.common().member_type_id(*sensor_msgs::msg::Getdouble__9Identifier(true)); cst_angular_velocity_covariance.detail().name("angular_velocity_covariance"); + { + AppliedAnnotation ann; + //ann.annotation_typeid(GetverbatimIdentifier(true)); + ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("verbatim")); + { + AppliedAnnotationParameter annParam; + MD5 message_hash("language"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(TK_NONE); + paramValue.from_string("comment"); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + { + AppliedAnnotationParameter annParam; + MD5 message_hash("placement"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(EK_MINIMAL); + paramValue.from_string("1"); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + { + AppliedAnnotationParameter annParam; + MD5 message_hash("text"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(TK_NONE); + paramValue.from_string("Row major about x, y, z axes"); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + cst_angular_velocity_covariance.detail().ann_custom().push_back(ann); + } + type_object->complete().struct_type().member_seq().emplace_back(cst_angular_velocity_covariance); CompleteStructMember cst_linear_acceleration; @@ -570,9 +668,58 @@ namespace sensor_msgs { cst_linear_acceleration_covariance.common().member_flags().IS_MUST_UNDERSTAND(false); cst_linear_acceleration_covariance.common().member_flags().IS_KEY(false); cst_linear_acceleration_covariance.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_linear_acceleration_covariance.common().member_type_id(*sensor_msgs::msg::Getsensor_msgs__Imu__double_array_9Identifier(true)); + cst_linear_acceleration_covariance.common().member_type_id(*sensor_msgs::msg::Getdouble__9Identifier(true)); cst_linear_acceleration_covariance.detail().name("linear_acceleration_covariance"); + { + AppliedAnnotation ann; + //ann.annotation_typeid(GetverbatimIdentifier(true)); + ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("verbatim")); + { + AppliedAnnotationParameter annParam; + MD5 message_hash("language"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(TK_NONE); + paramValue.from_string("comment"); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + { + AppliedAnnotationParameter annParam; + MD5 message_hash("placement"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(EK_MINIMAL); + paramValue.from_string("1"); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + { + AppliedAnnotationParameter annParam; + MD5 message_hash("text"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(TK_NONE); + paramValue.from_string("Row major x, y z"); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + cst_linear_acceleration_covariance.detail().ann_custom().push_back(ann); + } + type_object->complete().struct_type().member_seq().emplace_back(cst_linear_acceleration_covariance); @@ -580,6 +727,55 @@ namespace sensor_msgs { type_object->complete().struct_type().header().detail().type_name("Imu"); // TODO inheritance + { + AppliedAnnotation ann; + //ann.annotation_typeid(GetverbatimIdentifier(true)); + ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("verbatim")); + { + AppliedAnnotationParameter annParam; + MD5 message_hash("language"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(TK_NONE); + paramValue.from_string("comment"); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + { + AppliedAnnotationParameter annParam; + MD5 message_hash("placement"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(EK_MINIMAL); + paramValue.from_string("1"); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + { + AppliedAnnotationParameter annParam; + MD5 message_hash("text"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(TK_NONE); + paramValue.from_string("This is a message to hold data from an IMU (Inertial Measurement Unit)\n\nAccelerations should be in m/s^2 (not in g's), and rotational velocity should be in rad/sec\n\nIf the covariance of the measurement is known, it should be filled in (if all you know is the\nvariance of each measurement, e.g. from the datasheet, just put those along the diagonal)\nA covariance matrix of all zeros will be interpreted as \"covariance unknown\", and to use the\ndata a covariance will have to be assumed or gotten from some other source\n\nIf you have no estimate for one of the data elements (e.g. your IMU doesn't produce an\norientation estimate), please set element 0 of the associated covariance matrix to -1\nIf you are interpreting this message, please check for a value of -1 in the first element of each\ncovariance matrix, and disregard the associated estimate."); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + type_object->complete().struct_type().header().detail().ann_custom().push_back(ann); + } + TypeIdentifier identifier; identifier._d(EK_COMPLETE); diff --git a/third-party/realdds/src/topics/ros2/ros2imuTypeObject.h b/third-party/realdds/src/topics/ros2/sensor_msgs/msg/ImuTypeObject.h similarity index 70% rename from third-party/realdds/src/topics/ros2/ros2imuTypeObject.h rename to third-party/realdds/src/topics/ros2/sensor_msgs/msg/ImuTypeObject.h index ce22eaa64a..6b584598fd 100644 --- a/third-party/realdds/src/topics/ros2/ros2imuTypeObject.h +++ b/third-party/realdds/src/topics/ros2/sensor_msgs/msg/ImuTypeObject.h @@ -1,5 +1,5 @@ // License: Apache 2.0. See LICENSE file in root directory. -// Copyright(c) 2023 Intel Corporation. All Rights Reserved. +// Copyright(c) 2023-5 Intel Corporation. All Rights Reserved. /*! * @file ImuTypeObject.h @@ -11,9 +11,9 @@ #ifndef _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_IMU_TYPE_OBJECT_H_ #define _FAST_DDS_GENERATED_SENSOR_MSGS_MSG_IMU_TYPE_OBJECT_H_ -#include "ros2vector3TypeObject.h" -#include "ros2quaternionTypeObject.h" -#include "ros2headerTypeObject.h" +#include "../../geometry_msgs/msg/Vector3TypeObject.h" +#include "../../geometry_msgs/msg/QuaternionTypeObject.h" +#include "../../std_msgs/msg/HeaderTypeObject.h" #include #include @@ -48,10 +48,10 @@ eProsima_user_DllExport void registerImuTypes(); namespace sensor_msgs { namespace msg { - eProsima_user_DllExport const TypeIdentifier* Getsensor_msgs__Imu__double_array_9Identifier(bool complete = false); - eProsima_user_DllExport const TypeObject* Getsensor_msgs__Imu__double_array_9Object(bool complete = false); - eProsima_user_DllExport const TypeObject* GetMinimalsensor_msgs__Imu__double_array_9Object(); - eProsima_user_DllExport const TypeObject* GetCompletesensor_msgs__Imu__double_array_9Object(); + eProsima_user_DllExport const TypeIdentifier* Getdouble__9Identifier(bool complete = false); + eProsima_user_DllExport const TypeObject* Getdouble__9Object(bool complete = false); + eProsima_user_DllExport const TypeObject* GetMinimaldouble__9Object(); + eProsima_user_DllExport const TypeObject* GetCompletedouble__9Object(); eProsima_user_DllExport const TypeIdentifier* GetImuIdentifier(bool complete = false); eProsima_user_DllExport const TypeObject* GetImuObject(bool complete = false); diff --git a/third-party/realdds/src/topics/ros2/ros2header.cpp b/third-party/realdds/src/topics/ros2/std_msgs/msg/Header.cpp similarity index 87% rename from third-party/realdds/src/topics/ros2/ros2header.cpp rename to third-party/realdds/src/topics/ros2/std_msgs/msg/Header.cpp index f6fe87e8fc..ca40e498a8 100644 --- a/third-party/realdds/src/topics/ros2/ros2header.cpp +++ b/third-party/realdds/src/topics/ros2/std_msgs/msg/Header.cpp @@ -1,5 +1,5 @@ // License: Apache 2.0. See LICENSE file in root directory. -// Copyright(c) 2023 Intel Corporation. All Rights Reserved. +// Copyright(c) 2023-5 Intel Corporation. All Rights Reserved. /*! * @file Header.cpp @@ -15,8 +15,8 @@ char dummy; } // namespace #endif // _WIN32 -#include -#include "ros2headerTypeObject.h" +#include +#include "HeaderTypeObject.h" #include #include @@ -26,9 +26,9 @@ using namespace eprosima::fastcdr::exception; std_msgs::msg::Header::Header() { - // m_stamp com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@7adda9cc + // m_stamp com.eprosima.fastdds.idl.parser.typecode.StructTypeCode@6b19b79 - // m_frame_id com.eprosima.idl.parser.typecode.StringTypeCode@5cee5251 + // m_frame_id com.eprosima.idl.parser.typecode.StringTypeCode@2a32de6c m_frame_id =""; // Just to register all known types @@ -94,7 +94,7 @@ size_t std_msgs::msg::Header::getMaxCdrSerializedSize( size_t initial_alignment = current_alignment; - current_alignment += std_msgs::msg::Time::getMaxCdrSerializedSize(current_alignment); + current_alignment += builtin_interfaces::msg::Time::getMaxCdrSerializedSize(current_alignment); current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1; @@ -109,7 +109,7 @@ size_t std_msgs::msg::Header::getCdrSerializedSize( size_t initial_alignment = current_alignment; - current_alignment += std_msgs::msg::Time::getCdrSerializedSize(data.stamp(), current_alignment); + current_alignment += builtin_interfaces::msg::Time::getCdrSerializedSize(data.stamp(), current_alignment); current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.frame_id().size() + 1; @@ -138,7 +138,7 @@ void std_msgs::msg::Header::deserialize( * @param _stamp New value to be copied in member stamp */ void std_msgs::msg::Header::stamp( - const std_msgs::msg::Time& _stamp) + const builtin_interfaces::msg::Time& _stamp) { m_stamp = _stamp; } @@ -148,7 +148,7 @@ void std_msgs::msg::Header::stamp( * @param _stamp New value to be moved in member stamp */ void std_msgs::msg::Header::stamp( - std_msgs::msg::Time&& _stamp) + builtin_interfaces::msg::Time&& _stamp) { m_stamp = std::move(_stamp); } @@ -157,7 +157,7 @@ void std_msgs::msg::Header::stamp( * @brief This function returns a constant reference to member stamp * @return Constant reference to member stamp */ -const std_msgs::msg::Time& std_msgs::msg::Header::stamp() const +const builtin_interfaces::msg::Time& std_msgs::msg::Header::stamp() const { return m_stamp; } @@ -166,7 +166,7 @@ const std_msgs::msg::Time& std_msgs::msg::Header::stamp() const * @brief This function returns a reference to member stamp * @return Reference to member stamp */ -std_msgs::msg::Time& std_msgs::msg::Header::stamp() +builtin_interfaces::msg::Time& std_msgs::msg::Header::stamp() { return m_stamp; } diff --git a/third-party/realdds/src/topics/ros2/ros2headerPubSubTypes.cpp b/third-party/realdds/src/topics/ros2/std_msgs/msg/HeaderPubSubTypes.cpp similarity index 96% rename from third-party/realdds/src/topics/ros2/ros2headerPubSubTypes.cpp rename to third-party/realdds/src/topics/ros2/std_msgs/msg/HeaderPubSubTypes.cpp index 3b60debffa..b383b4b14f 100644 --- a/third-party/realdds/src/topics/ros2/ros2headerPubSubTypes.cpp +++ b/third-party/realdds/src/topics/ros2/std_msgs/msg/HeaderPubSubTypes.cpp @@ -1,5 +1,5 @@ // License: Apache 2.0. See LICENSE file in root directory. -// Copyright(c) 2023 Intel Corporation. All Rights Reserved. +// Copyright(c) 2023-5 Intel Corporation. All Rights Reserved. /*! * @file HeaderPubSubTypes.cpp @@ -12,7 +12,7 @@ #include #include -#include +#include using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; @@ -21,7 +21,7 @@ namespace std_msgs { namespace msg { HeaderPubSubType::HeaderPubSubType() { - setName("std_msgs::msg::Header"); + setName("std_msgs::msg::dds_::Header_"); auto type_size = Header::getMaxCdrSerializedSize(); type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ diff --git a/third-party/realdds/src/topics/ros2/ros2headerTypeObject.cpp b/third-party/realdds/src/topics/ros2/std_msgs/msg/HeaderTypeObject.cpp similarity index 58% rename from third-party/realdds/src/topics/ros2/ros2headerTypeObject.cpp rename to third-party/realdds/src/topics/ros2/std_msgs/msg/HeaderTypeObject.cpp index 2bce337ab7..369a60375f 100644 --- a/third-party/realdds/src/topics/ros2/ros2headerTypeObject.cpp +++ b/third-party/realdds/src/topics/ros2/std_msgs/msg/HeaderTypeObject.cpp @@ -1,5 +1,5 @@ // License: Apache 2.0. See LICENSE file in root directory. -// Copyright(c) 2023 Intel Corporation. All Rights Reserved. +// Copyright(c) 2023-5 Intel Corporation. All Rights Reserved. /*! * @file HeaderTypeObject.cpp @@ -13,8 +13,8 @@ namespace { char dummy; } #endif -#include -#include "ros2headerTypeObject.h" +#include +#include "HeaderTypeObject.h" #include #include #include @@ -30,10 +30,10 @@ using namespace eprosima::fastrtps::rtps; void registerHeaderTypes() { TypeObjectFactory *factory = TypeObjectFactory::get_instance(); - factory->add_type_object("std_msgs::msg::Time", std_msgs::msg::GetTimeIdentifier(true), - std_msgs::msg::GetTimeObject(true)); - factory->add_type_object("std_msgs::msg::Time", std_msgs::msg::GetTimeIdentifier(false), - std_msgs::msg::GetTimeObject(false)); + factory->add_type_object("builtin_interfaces::msg::Time", builtin_interfaces::msg::GetTimeIdentifier(true), + builtin_interfaces::msg::GetTimeObject(true)); + factory->add_type_object("builtin_interfaces::msg::Time", builtin_interfaces::msg::GetTimeIdentifier(false), + builtin_interfaces::msg::GetTimeObject(false)); @@ -103,7 +103,7 @@ namespace std_msgs { mst_stamp.common().member_flags().IS_MUST_UNDERSTAND(false); mst_stamp.common().member_flags().IS_KEY(false); mst_stamp.common().member_flags().IS_DEFAULT(false); // Doesn't apply - mst_stamp.common().member_type_id(*std_msgs::msg::GetTimeIdentifier(false)); + mst_stamp.common().member_type_id(*builtin_interfaces::msg::GetTimeIdentifier(false)); MD5 stamp_hash("stamp"); for(int i = 0; i < 4; ++i) { @@ -191,9 +191,58 @@ namespace std_msgs { cst_stamp.common().member_flags().IS_MUST_UNDERSTAND(false); cst_stamp.common().member_flags().IS_KEY(false); cst_stamp.common().member_flags().IS_DEFAULT(false); // Doesn't apply - cst_stamp.common().member_type_id(*std_msgs::msg::GetTimeIdentifier(true)); + cst_stamp.common().member_type_id(*builtin_interfaces::msg::GetTimeIdentifier(true)); cst_stamp.detail().name("stamp"); + { + AppliedAnnotation ann; + //ann.annotation_typeid(GetverbatimIdentifier(true)); + ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("verbatim")); + { + AppliedAnnotationParameter annParam; + MD5 message_hash("language"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(TK_NONE); + paramValue.from_string("comment"); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + { + AppliedAnnotationParameter annParam; + MD5 message_hash("placement"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(EK_MINIMAL); + paramValue.from_string("1"); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + { + AppliedAnnotationParameter annParam; + MD5 message_hash("text"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(TK_NONE); + paramValue.from_string("Two-integer timestamp that is expressed as seconds and nanoseconds."); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + cst_stamp.detail().ann_custom().push_back(ann); + } + type_object->complete().struct_type().member_seq().emplace_back(cst_stamp); CompleteStructMember cst_frame_id; @@ -210,6 +259,55 @@ namespace std_msgs { cst_frame_id.detail().name("frame_id"); + { + AppliedAnnotation ann; + //ann.annotation_typeid(GetverbatimIdentifier(true)); + ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("verbatim")); + { + AppliedAnnotationParameter annParam; + MD5 message_hash("language"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(TK_NONE); + paramValue.from_string("comment"); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + { + AppliedAnnotationParameter annParam; + MD5 message_hash("placement"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(EK_MINIMAL); + paramValue.from_string("1"); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + { + AppliedAnnotationParameter annParam; + MD5 message_hash("text"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(TK_NONE); + paramValue.from_string("Transform frame with which this data is associated."); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + cst_frame_id.detail().ann_custom().push_back(ann); + } + type_object->complete().struct_type().member_seq().emplace_back(cst_frame_id); @@ -217,6 +315,55 @@ namespace std_msgs { type_object->complete().struct_type().header().detail().type_name("Header"); // TODO inheritance + { + AppliedAnnotation ann; + //ann.annotation_typeid(GetverbatimIdentifier(true)); + ann.annotation_typeid(*TypeObjectFactory::get_instance()->get_type_identifier_trying_complete("verbatim")); + { + AppliedAnnotationParameter annParam; + MD5 message_hash("language"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(TK_NONE); + paramValue.from_string("comment"); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + { + AppliedAnnotationParameter annParam; + MD5 message_hash("placement"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(EK_MINIMAL); + paramValue.from_string("1"); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + { + AppliedAnnotationParameter annParam; + MD5 message_hash("text"); + for(int i = 0; i < 4; ++i) + { + annParam.paramname_hash()[i] = message_hash.digest[i]; + } + AnnotationParameterValue paramValue; + paramValue._d(TK_NONE); + paramValue.from_string("Standard metadata for higher-level stamped data types.\nThis is generally used to communicate timestamped data\nin a particular coordinate frame."); + annParam.value(paramValue); + ann.param_seq().push_back(annParam); + } + + type_object->complete().struct_type().header().detail().ann_custom().push_back(ann); + } + TypeIdentifier identifier; identifier._d(EK_COMPLETE); diff --git a/third-party/realdds/src/topics/ros2/ros2headerTypeObject.h b/third-party/realdds/src/topics/ros2/std_msgs/msg/HeaderTypeObject.h similarity index 92% rename from third-party/realdds/src/topics/ros2/ros2headerTypeObject.h rename to third-party/realdds/src/topics/ros2/std_msgs/msg/HeaderTypeObject.h index 97b89b0343..6406f07db2 100644 --- a/third-party/realdds/src/topics/ros2/ros2headerTypeObject.h +++ b/third-party/realdds/src/topics/ros2/std_msgs/msg/HeaderTypeObject.h @@ -1,5 +1,5 @@ // License: Apache 2.0. See LICENSE file in root directory. -// Copyright(c) 2023 Intel Corporation. All Rights Reserved. +// Copyright(c) 2023-5 Intel Corporation. All Rights Reserved. /*! * @file HeaderTypeObject.h @@ -11,7 +11,7 @@ #ifndef _FAST_DDS_GENERATED_STD_MSGS_MSG_HEADER_TYPE_OBJECT_H_ #define _FAST_DDS_GENERATED_STD_MSGS_MSG_HEADER_TYPE_OBJECT_H_ -#include "ros2timeTypeObject.h" +#include "../../builtin_interfaces/msg/TimeTypeObject.h" #include #include diff --git a/tools/dds/dds-adapter/lrs-device-controller.cpp b/tools/dds/dds-adapter/lrs-device-controller.cpp index 18b59274e5..09e957bb49 100644 --- a/tools/dds/dds-adapter/lrs-device-controller.cpp +++ b/tools/dds/dds-adapter/lrs-device-controller.cpp @@ -9,7 +9,6 @@ #include #include #include -#include #include #include #include