├── .gitignore ├── README.md ├── ros2 ├── .gitignore ├── LICENSE ├── README.md ├── TimerBase.h ├── builtin_interfaces │ ├── Duration.hpp │ └── Time.hpp ├── diagnostic_msgs │ └── KeyValue.hpp ├── geometry_msgs │ ├── Point.hpp │ ├── Pose.hpp │ ├── PoseStamped.hpp │ ├── PoseWithCovariance.hpp │ ├── Quaternion.hpp │ ├── Transform.hpp │ ├── TransformStamped.hpp │ ├── Twist.hpp │ ├── TwistWithCovariance.hpp │ └── Vector3.hpp ├── msg_list.hpp ├── nav_msgs │ ├── Odometry.hpp │ └── Path.hpp ├── node_handle.hpp ├── publisher.hpp ├── rcl_interfaces │ ├── FloatingPointRange.hpp │ ├── IntegerRange.hpp │ ├── IntraProcessMessage.hpp │ ├── ListParametersResult.hpp │ ├── Log.hpp │ ├── Parameter.hpp │ ├── ParameterDescriptor.hpp │ ├── ParameterEvent.hpp │ ├── ParameterEventDescriptors.hpp │ ├── ParameterType.hpp │ ├── ParameterValue.hpp │ └── SetParametersResult.hpp ├── ros2.cpp ├── ros2.hpp ├── sensor_msgs │ ├── BatteryState.hpp │ ├── Imu.hpp │ ├── JointState.hpp │ ├── Joy.hpp │ ├── LaserScan.hpp │ └── MagneticField.hpp ├── std_msgs │ ├── Bool.hpp │ ├── Byte.hpp │ ├── Char.hpp │ ├── ColorRGBA.hpp │ ├── Empty.hpp │ ├── Float32.hpp │ ├── Float64.hpp │ ├── Header.hpp │ ├── Int16.hpp │ ├── Int32.hpp │ ├── Int64.hpp │ ├── Int8.hpp │ ├── MultiArrayDimension.hpp │ ├── MultiArrayLayout.hpp │ ├── String.hpp │ ├── UInt16.hpp │ ├── UInt32.hpp │ ├── UInt32MultiArray.hpp │ ├── UInt64.hpp │ ├── UInt64MultiArray.hpp │ ├── UInt8.hpp │ └── UInt8MultiArray.hpp ├── subscription.hpp ├── tf2_msgs │ └── TFMessage.hpp ├── topic.hpp ├── topic_id_number.h ├── turtlebot3_msgs │ ├── SensorState.hpp │ ├── Sound.hpp │ └── VersionInfo.hpp └── xrcedds │ ├── .gitignore │ ├── dds_time.h │ ├── micro_xrce_dds │ ├── lib │ │ ├── LICENSE │ │ ├── README.md │ │ ├── client.config │ │ ├── include │ │ │ └── uxr │ │ │ │ └── client │ │ │ │ ├── client.h │ │ │ │ ├── config.h.in │ │ │ │ ├── core │ │ │ │ ├── communication │ │ │ │ │ └── communication.h │ │ │ │ ├── session │ │ │ │ │ ├── common_create_entities.h │ │ │ │ │ ├── create_entities_ref.h │ │ │ │ │ ├── create_entities_xml.h │ │ │ │ │ ├── object_id.h │ │ │ │ │ ├── read_access.h │ │ │ │ │ ├── session.h │ │ │ │ │ ├── session_info.h │ │ │ │ │ ├── stream │ │ │ │ │ │ ├── input_best_effort_stream.h │ │ │ │ │ │ ├── input_reliable_stream.h │ │ │ │ │ │ ├── output_best_effort_stream.h │ │ │ │ │ │ ├── output_reliable_stream.h │ │ │ │ │ │ ├── reliable_stream.h │ │ │ │ │ │ ├── seq_num.h │ │ │ │ │ │ ├── stream_id.h │ │ │ │ │ │ └── stream_storage.h │ │ │ │ │ ├── time_sync.h │ │ │ │ │ └── write_access.h │ │ │ │ └── type │ │ │ │ │ └── xrce_types.h │ │ │ │ ├── defines.h │ │ │ │ ├── profile │ │ │ │ ├── discovery │ │ │ │ │ └── discovery.h │ │ │ │ └── transport │ │ │ │ │ ├── ip │ │ │ │ │ ├── ip.h │ │ │ │ │ ├── tcp │ │ │ │ │ │ ├── tcp_transport.h │ │ │ │ │ │ ├── tcp_transport_external.h.template │ │ │ │ │ │ ├── tcp_transport_posix.h │ │ │ │ │ │ └── tcp_transport_windows.h │ │ │ │ │ └── udp │ │ │ │ │ │ ├── udp_transport.h │ │ │ │ │ │ ├── udp_transport_external.h.template │ │ │ │ │ │ ├── udp_transport_posix.h │ │ │ │ │ │ ├── udp_transport_posix_nopoll.h │ │ │ │ │ │ └── udp_transport_windows.h │ │ │ │ │ └── serial │ │ │ │ │ ├── serial_protocol.h │ │ │ │ │ ├── serial_transport.h │ │ │ │ │ ├── serial_transport_external.h.template │ │ │ │ │ ├── serial_transport_platform.h │ │ │ │ │ ├── serial_transport_posix.h │ │ │ │ │ └── serial_transport_windows.h │ │ │ │ ├── transport.h │ │ │ │ ├── util │ │ │ │ └── dds_lib_time.h │ │ │ │ └── visibility.h │ │ ├── src │ │ │ └── c │ │ │ │ ├── core │ │ │ │ ├── log │ │ │ │ │ ├── log.c │ │ │ │ │ └── log_internal.h │ │ │ │ ├── serialization │ │ │ │ │ ├── xrce_header.c │ │ │ │ │ ├── xrce_header_internal.h │ │ │ │ │ ├── xrce_subheader.c │ │ │ │ │ ├── xrce_subheader_internal.h │ │ │ │ │ └── xrce_types.c │ │ │ │ └── session │ │ │ │ │ ├── common_create_entities.c │ │ │ │ │ ├── common_create_entities_internal.h │ │ │ │ │ ├── create_entities_ref.c │ │ │ │ │ ├── create_entities_xml.c │ │ │ │ │ ├── object_id.c │ │ │ │ │ ├── read_access.c │ │ │ │ │ ├── session.c │ │ │ │ │ ├── session_info.c │ │ │ │ │ ├── session_info_internal.h │ │ │ │ │ ├── session_internal.h │ │ │ │ │ ├── stream │ │ │ │ │ ├── common_reliable_stream_internal.h │ │ │ │ │ ├── input_best_effort_stream.c │ │ │ │ │ ├── input_best_effort_stream_internal.h │ │ │ │ │ ├── input_reliable_stream.c │ │ │ │ │ ├── input_reliable_stream_internal.h │ │ │ │ │ ├── output_best_effort_stream.c │ │ │ │ │ ├── output_best_effort_stream_internal.h │ │ │ │ │ ├── output_reliable_stream.c │ │ │ │ │ ├── output_reliable_stream_internal.h │ │ │ │ │ ├── seq_num.c │ │ │ │ │ ├── seq_num_internal.h │ │ │ │ │ ├── stream_id.c │ │ │ │ │ ├── stream_storage.c │ │ │ │ │ └── stream_storage_internal.h │ │ │ │ │ ├── submessage.c │ │ │ │ │ ├── submessage_internal.h │ │ │ │ │ └── write_access.c │ │ │ │ ├── profile │ │ │ │ ├── discovery │ │ │ │ │ ├── discovery.c │ │ │ │ │ └── transport │ │ │ │ │ │ ├── udp_transport_datagram_internal.h │ │ │ │ │ │ ├── udp_transport_datagram_mbed_tmp.c │ │ │ │ │ │ ├── udp_transport_datagram_posix.c │ │ │ │ │ │ └── udp_transport_datagram_windows.c │ │ │ │ └── transport │ │ │ │ │ ├── ip │ │ │ │ │ ├── ip_posix.c │ │ │ │ │ ├── ip_windows.c │ │ │ │ │ ├── tcp │ │ │ │ │ │ ├── tcp_transport.c │ │ │ │ │ │ ├── tcp_transport_external.c.template │ │ │ │ │ │ ├── tcp_transport_internal.h │ │ │ │ │ │ ├── tcp_transport_posix.c │ │ │ │ │ │ └── tcp_transport_windows.c │ │ │ │ │ └── udp │ │ │ │ │ │ ├── udp_transport.c │ │ │ │ │ │ ├── udp_transport_external.c.template │ │ │ │ │ │ ├── udp_transport_internal.h │ │ │ │ │ │ ├── udp_transport_posix.c │ │ │ │ │ │ ├── udp_transport_posix_nopoll.c │ │ │ │ │ │ └── udp_transport_windows.c │ │ │ │ │ └── serial │ │ │ │ │ ├── serial_protocol.c │ │ │ │ │ ├── serial_protocol_internal.h │ │ │ │ │ ├── serial_transport.c │ │ │ │ │ ├── serial_transport_external.c.template │ │ │ │ │ ├── serial_transport_posix.c │ │ │ │ │ └── serial_transport_windows.c │ │ │ │ └── util │ │ │ │ ├── time.c │ │ │ │ └── time_internal.h │ │ └── thirdparty │ │ │ └── microcdr │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── include │ │ │ └── ucdr │ │ │ │ ├── config.h.in │ │ │ │ ├── microcdr.h │ │ │ │ └── visibility.h │ │ │ └── src │ │ │ └── c │ │ │ ├── common.c │ │ │ ├── common_internal.h │ │ │ └── types │ │ │ ├── array.c │ │ │ ├── basic.c │ │ │ ├── sequence.c │ │ │ └── string.c │ ├── micro_xrce_dds.c │ ├── micro_xrce_dds.h │ ├── micro_xrce_dds_time.c │ ├── micro_xrce_dds_xml.h │ └── transport_ex.h │ ├── xrcedds.cpp │ ├── xrcedds.hpp │ ├── xrcedds_cpp_helper.cpp │ └── xrcedds_cpp_helper.hpp ├── ros2mbed.cpp ├── ros2mbed.h ├── ucdr ├── common.h ├── config.h ├── microcdr.h └── visibility.h ├── user_config.h └── uxr ├── client ├── client.h ├── config.h ├── core │ ├── communication │ │ └── communication.h │ ├── session │ │ ├── common_create_entities.h │ │ ├── create_entities_ref.h │ │ ├── create_entities_xml.h │ │ ├── object_id.h │ │ ├── read_access.h │ │ ├── session.h │ │ ├── session_info.h │ │ ├── stream │ │ │ ├── input_best_effort_stream.h │ │ │ ├── input_reliable_stream.h │ │ │ ├── output_best_effort_stream.h │ │ │ ├── output_reliable_stream.h │ │ │ ├── reliable_stream.h │ │ │ ├── seq_num.h │ │ │ ├── stream_id.h │ │ │ └── stream_storage.h │ │ └── write_access.h │ └── type │ │ └── xrce_types.h ├── defines.h ├── profile │ ├── discovery │ │ └── discovery.h │ └── transport │ │ ├── ip │ │ ├── ip.h │ │ ├── tcp │ │ │ ├── tcp_transport.h │ │ │ ├── tcp_transport_external.h │ │ │ └── tcp_transport_mbed.c │ │ └── udp │ │ │ ├── udp_transport.h │ │ │ ├── udp_transport_external.h │ │ │ └── udp_transport_mbed.c │ │ ├── serial │ │ ├── serial_protocol.h │ │ ├── serial_transport.h │ │ ├── serial_transport_external.h │ │ ├── serial_transport_mbed.c │ │ └── serial_transport_platform.h │ │ ├── transport_mbed_internal.cpp │ │ └── transport_mbed_internal.h ├── transport.h ├── util │ └── uxr_time.h └── visibility.h └── xrcedds_time.cpp /.gitignore: -------------------------------------------------------------------------------- 1 | .vscode/ -------------------------------------------------------------------------------- /ros2/.gitignore: -------------------------------------------------------------------------------- 1 | /.project 2 | /.DS_Store* 3 | -------------------------------------------------------------------------------- /ros2/TimerBase.h: -------------------------------------------------------------------------------- 1 | #ifndef ROS2_TIMERBASE_HPP_ 2 | #define ROS2_TIMERBASE_HPP_ 3 | 4 | #include "node_handle.hpp" 5 | #include 6 | #include 7 | #include 8 | 9 | namespace ros2 { 10 | 11 | class TimerBase 12 | { 13 | public: 14 | using SharedPtr = std::shared_ptr; 15 | 16 | TimerBase(std::chrono::milliseconds msec, std::function callback) 17 | { 18 | setInterval(msec.count()); 19 | callback_ = callback; 20 | last_call_time_ms_ = 0; 21 | } 22 | 23 | void setInterval(uint32_t msec) 24 | { 25 | this->callback_interval_ms_ = msec; 26 | } 27 | 28 | bool isTimeToCallback() 29 | { 30 | if(this->callback_interval_ms_ > 0 && dds_getMilliseconds() - this->last_call_time_ms_ >= this->callback_interval_ms_) 31 | { 32 | this->last_call_time_ms_ = dds_getMilliseconds(); 33 | return true; 34 | } 35 | return false; 36 | } 37 | 38 | void call() 39 | { 40 | callback_(); 41 | } 42 | 43 | private: 44 | uint32_t callback_interval_ms_; 45 | uint32_t last_call_time_ms_; 46 | std::function callback_; 47 | }; 48 | 49 | } 50 | 51 | #endif // ROS2_TIMERBASE_HPP_ -------------------------------------------------------------------------------- /ros2/builtin_interfaces/Duration.hpp: -------------------------------------------------------------------------------- 1 | #ifndef _BUILTIN_INTERFACES_DURATION_H_ 2 | #define _BUILTIN_INTERFACES_DURATION_H_ 3 | 4 | #include "../topic.hpp" 5 | 6 | // Manualy include list 7 | 8 | namespace builtin_interfaces 9 | { 10 | 11 | class Duration: public ros2::Topic 12 | { 13 | public: 14 | using SharedPtr = std::shared_ptr; 15 | 16 | int32_t sec; 17 | uint32_t nanosec; 18 | 19 | Duration() 20 | : Topic("builtin_interfaces::msg::dds_::Duration_", "Duration", BUILTIN_INTERFACES_DURATION_ID), 21 | sec(0), 22 | nanosec(0) 23 | { 24 | } 25 | 26 | bool serialize(void* msg_buf, Duration* topic) 27 | { 28 | ucdrBuffer* writer = (ucdrBuffer*)msg_buf; 29 | (void) ucdr_serialize_int32_t(writer, topic->sec); 30 | (void) ucdr_serialize_uint32_t(writer, topic->nanosec); 31 | 32 | return !writer->error; 33 | } 34 | 35 | bool deserialize(void* msg_buf, Duration* topic) 36 | { 37 | ucdrBuffer* reader = (ucdrBuffer*)msg_buf; 38 | (void) ucdr_deserialize_int32_t(reader, &topic->sec); 39 | (void) ucdr_deserialize_uint32_t(reader, &topic->nanosec); 40 | 41 | return !reader->error; 42 | } 43 | 44 | uint32_t size_of_topic(const Duration* topic, uint32_t size) 45 | { 46 | (void) (topic); 47 | 48 | uint32_t previousSize = size; 49 | size += ucdr_alignment(size, 4) + 4; 50 | size += ucdr_alignment(size, 4) + 4; 51 | 52 | return size - previousSize; 53 | } 54 | 55 | }; 56 | 57 | } // namespace builtin_interfaces 58 | 59 | #endif // _BUILTIN_INTERFACES_DURATION_H_ -------------------------------------------------------------------------------- /ros2/builtin_interfaces/Time.hpp: -------------------------------------------------------------------------------- 1 | #ifndef _BUILTIN_INTERFACES_TIME_H_ 2 | #define _BUILTIN_INTERFACES_TIME_H_ 3 | 4 | #include "../topic.hpp" 5 | 6 | // Manualy include list 7 | 8 | namespace builtin_interfaces 9 | { 10 | 11 | class Time: public ros2::Topic