├── ThirdParty └── bson │ ├── include │ ├── mac │ │ ├── bson-stdint.h │ │ ├── bson-value.h │ │ ├── bson-keys.h │ │ ├── bson-clock.h │ │ ├── bson-context.h │ │ ├── bson-error.h │ │ ├── bson-version-functions.h │ │ ├── bson-utf8.h │ │ ├── bson-decimal128.h │ │ ├── bson-memory.h │ │ └── bson-writer.h │ ├── windows │ │ ├── bson-stdint.h │ │ ├── bson-value.h │ │ ├── bson-keys.h │ │ ├── bson-clock.h │ │ ├── bson-context.h │ │ ├── bson-version-functions.h │ │ ├── bson-error.h │ │ └── bson-utf8.h │ └── linux │ │ ├── bson-stdint.h │ │ ├── bson-value.h │ │ ├── bson-keys.h │ │ ├── bson-clock.h │ │ ├── bson-context.h │ │ ├── bson-version-functions.h │ │ ├── bson-error.h │ │ ├── bson-utf8.h │ │ └── bson-decimal128.h │ └── lib │ ├── bson-1.0.lib │ ├── libbson-1.0.a │ ├── bson-static-1.0.lib │ └── libbson-static-1.0.a ├── Config ├── Engine.ini └── FilterPlugin.ini ├── Documentation ├── bp_topic-01.png ├── bp_topic-02.png ├── ue4-setup-01.png ├── ue4-setup-02.png └── ue4-setup-03.png ├── Source └── ROSIntegration │ ├── Public │ ├── ros_version.h │ ├── ROSBaseServiceRequest.h │ ├── ROSBaseMsg.h │ ├── ROSBaseServiceResponse.h │ ├── std_srvs │ │ ├── TriggerRequest.h │ │ └── TriggerResponse.h │ ├── std_msgs │ │ ├── Bool.h │ │ ├── Empty.h │ │ ├── Int32.h │ │ ├── Int64.h │ │ ├── UInt8.h │ │ ├── Float32.h │ │ ├── String.h │ │ ├── Header.h │ │ ├── Float32MultiArray.h │ │ ├── MultiArrayLayout.h │ │ ├── MultiArrayDimension.h │ │ ├── ColorRGBA.h │ │ └── UInt8MultiArray.h │ ├── rospy_tutorials │ │ ├── AddTwoIntsRequest.h │ │ └── AddTwoIntsResponse.h │ ├── tf2_msgs │ │ └── TFMessage.h │ ├── geometry_msgs │ │ ├── Twist.h │ │ ├── Pose.h │ │ ├── PoseStamped.h │ │ ├── TwistStamped.h │ │ ├── Transform.h │ │ ├── TransformStamped.h │ │ ├── Point.h │ │ ├── Vector3.h │ │ ├── PoseWithCovariance.h │ │ ├── TwistWithCovariance.h │ │ └── Quaternion.h │ ├── rosgraph_msgs │ │ └── Clock.h │ ├── sensor_msgs │ │ ├── RegionOfInterest.h │ │ ├── MagneticField.h │ │ ├── Imu.h │ │ ├── CameraInfo.h │ │ ├── CompressedImage.h │ │ ├── NavSatStatus.h │ │ ├── NavSatFix.h │ │ ├── PointCloud2.h │ │ ├── JointState.h │ │ ├── LaserScan.h │ │ └── Image.h │ ├── nav_msgs │ │ ├── Path.h │ │ ├── OccupancyGrid.h │ │ ├── Odometry.h │ │ └── MapMetaData.h │ ├── ROSTime.h │ ├── actionlib_msgs │ │ ├── GoalStatusArray.h │ │ └── GoalID.h │ ├── grid_map_msgs │ │ ├── GridMapInfo.h │ │ └── GridMap.h │ └── ROSIntegration.h │ ├── Private │ ├── SpawnObjectMessage.cpp │ ├── Conversion │ │ ├── Messages │ │ │ ├── BaseMessageConverter.cpp │ │ │ ├── std_msgs │ │ │ │ ├── StdMsgsStringConverter.h │ │ │ │ ├── StdMsgsEmptyConverter.cpp │ │ │ │ ├── StdMsgsFloat32Converter.h │ │ │ │ ├── StdMsgsInt32Converter.h │ │ │ │ ├── StdMsgsInt64Converter.h │ │ │ │ ├── StdMsgsUInt8Converter.h │ │ │ │ ├── StdMsgsBoolConverter.h │ │ │ │ ├── StdMsgsEmptyConverter.h │ │ │ │ ├── StdMsgsHeaderConverter.cpp │ │ │ │ ├── StdMsgsColorRGBAConverter.cpp │ │ │ │ ├── StdMsgsInt32Converter.cpp │ │ │ │ ├── StdMsgsInt64Converter.cpp │ │ │ │ ├── StdMsgsMultiArrayLayoutConverter.cpp │ │ │ │ ├── StdMsgsUInt8MultiArrayConverter.cpp │ │ │ │ ├── StdMsgsFloat32Converter.cpp │ │ │ │ ├── StdMsgsStringConverter.cpp │ │ │ │ ├── StdMsgsFloat32MultiArrayConverter.cpp │ │ │ │ ├── StdMsgsMultiArrayDimensionConverter.cpp │ │ │ │ ├── StdMsgsBoolConverter.cpp │ │ │ │ ├── StdMsgsUInt8Converter.cpp │ │ │ │ ├── StdMsgsColorRGBAConverter.h │ │ │ │ ├── StdMsgsFloat32MultiArrayConverter.h │ │ │ │ ├── StdMsgsMultiArrayDimensionConverter.h │ │ │ │ ├── StdMsgsHeaderConverter.h │ │ │ │ └── StdMsgsUInt8MultiArrayConverter.h │ │ │ ├── nav_msgs │ │ │ │ ├── NavMsgsPathConverter.cpp │ │ │ │ ├── NavMsgsOdometryConverter.cpp │ │ │ │ ├── NavMsgsMapMetaDataConverter.cpp │ │ │ │ ├── NavMsgsOccupancyGridConverter.cpp │ │ │ │ └── NavMsgsOccupancyGridConverter.h │ │ │ ├── sensor_msgs │ │ │ │ ├── SensorMsgsImuConverter.cpp │ │ │ │ ├── SensorMsgsImageConverter.cpp │ │ │ │ ├── SensorMsgsLaserScanConverter.cpp │ │ │ │ ├── SensorMsgsNavSatFixConverter.cpp │ │ │ │ ├── SensorMsgsJointStateConverter.cpp │ │ │ │ ├── SensorMsgsNavSatStatusConverter.cpp │ │ │ │ ├── SensorMsgsPointCloud2Converter.cpp │ │ │ │ ├── SensorMsgsCompressedImageConverter.cpp │ │ │ │ ├── SensorMsgsMagneticFieldConverter.cpp │ │ │ │ ├── SensorMsgsRegionOfInterestConverter.cpp │ │ │ │ ├── SensorMsgsCameraInfoConverter.cpp │ │ │ │ ├── SensorMsgsNavSatStatusConverter.h │ │ │ │ └── SensorMsgsCompressedImageConverter.h │ │ │ ├── rosgraph_msgs │ │ │ │ ├── ROSGraphMsgsClockConverter.cpp │ │ │ │ └── ROSGraphMsgsClockConverter.h │ │ │ ├── grid_map_msgs │ │ │ │ ├── GridMapMsgsGridMapConverter.cpp │ │ │ │ └── GridMapMsgsGridMapInfoConverter.cpp │ │ │ ├── geometry_msgs │ │ │ │ ├── GeometryMsgsPoseConverter.cpp │ │ │ │ ├── GeometryMsgsTwistConverter.cpp │ │ │ │ ├── GeometryMsgsVector3Converter.cpp │ │ │ │ ├── GeometryMsgsPointConverter.cpp │ │ │ │ ├── GeometryMsgsQuaternionConverter.cpp │ │ │ │ ├── GeometryMsgsPoseStampedConverter.cpp │ │ │ │ ├── GeometryMsgsTransformConverter.cpp │ │ │ │ ├── GeometryMsgsTwistStampedConverter.cpp │ │ │ │ ├── GeometryMsgsPoseWithCovarianceConverter.cpp │ │ │ │ ├── GeometryMsgsTwistWithCovarianceConverter.cpp │ │ │ │ ├── GeometryMsgsTransformStampedConverter.cpp │ │ │ │ ├── GeometryMsgsPointConverter.h │ │ │ │ ├── GeometryMsgsVector3Converter.h │ │ │ │ ├── GeometryMsgsTwistConverter.h │ │ │ │ ├── GeometryMsgsPoseStampedConverter.h │ │ │ │ ├── GeometryMsgsPoseConverter.h │ │ │ │ ├── GeometryMsgsTwistStampedConverter.h │ │ │ │ ├── GeometryMsgsQuaternionConverter.h │ │ │ │ ├── GeometryMsgsTransformConverter.h │ │ │ │ ├── GeometryMsgsPoseWithCovarianceConverter.h │ │ │ │ └── GeometryMsgsTwistWithCovarianceConverter.h │ │ │ ├── actionlib_msgs │ │ │ │ ├── ActionlibMsgsGoalIDConverter.cpp │ │ │ │ ├── ActionlibMsgsGoalStatusConverter.cpp │ │ │ │ ├── ActionlibMsgsGoalStatusArrayConverter.cpp │ │ │ │ ├── ActionlibMsgsGoalIDConverter.h │ │ │ │ └── ActionlibMsgsGoalStatusConverter.h │ │ │ └── tf2_msgs │ │ │ │ └── Tf2MsgsTFMessageConverter.cpp │ │ └── Services │ │ │ ├── BaseRequestConverter.cpp │ │ │ ├── BaseResponseConverter.cpp │ │ │ ├── std_srvs │ │ │ ├── StdSrvsTriggerRequestConverter.h │ │ │ ├── StdSrvsTriggerResponseConverter.h │ │ │ ├── StdSrvsTriggerRequestConverter.cpp │ │ │ └── StdSrvsTriggerResponseConverter.cpp │ │ │ ├── rospy_tutorials │ │ │ ├── RospyTutorialsAddTwoIntsRequestConverter.h │ │ │ ├── RospyTutorialsAddTwoIntsResponseConverter.h │ │ │ └── RospyTutorialsAddTwoIntsResponseConverter.cpp │ │ │ ├── BaseRequestConverter.h │ │ │ └── BaseResponseConverter.h │ ├── rosbridge2cpp │ │ ├── ros_time.h │ │ ├── ros_tf_broadcaster.h │ │ ├── ros_tf_broadcaster.cpp │ │ ├── messages │ │ │ ├── rosbridge_unsubscribe_msg.h │ │ │ ├── rosbridge_unadvertise_msg.h │ │ │ ├── rosbridge_unadvertise_service_msg.h │ │ │ ├── rosbridge_advertise_service_msg.h │ │ │ ├── rosbridge_advertise_msg.h │ │ │ └── rosbridge_subscribe_msg.h │ │ ├── ros_time.cpp │ │ ├── spinlock.h │ │ ├── rapidjson │ │ │ └── internal │ │ │ │ └── swap.h │ │ └── WebsocketConnection.h │ ├── ROSIntegration.cpp │ └── ROSTime.cpp │ └── Classes │ ├── SpawnableObject.h │ ├── SpawnManager.h │ └── SpawnObjectMessage.h ├── ROSIntegration.uplugin ├── LICENSE └── .gitignore /ThirdParty/bson/include/mac/bson-stdint.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /ThirdParty/bson/include/windows/bson-stdint.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /Config/Engine.ini: -------------------------------------------------------------------------------- 1 | [WebSockets.LibWebSockets] 2 | ThreadTargetFrameTimeInSeconds = 0.0 3 | -------------------------------------------------------------------------------- /Documentation/bp_topic-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-iai/ROSIntegration/HEAD/Documentation/bp_topic-01.png -------------------------------------------------------------------------------- /Documentation/bp_topic-02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-iai/ROSIntegration/HEAD/Documentation/bp_topic-02.png -------------------------------------------------------------------------------- /Source/ROSIntegration/Public/ros_version.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | extern uint8 ROS_VERSION; -------------------------------------------------------------------------------- /Documentation/ue4-setup-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-iai/ROSIntegration/HEAD/Documentation/ue4-setup-01.png -------------------------------------------------------------------------------- /Documentation/ue4-setup-02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-iai/ROSIntegration/HEAD/Documentation/ue4-setup-02.png -------------------------------------------------------------------------------- /Documentation/ue4-setup-03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-iai/ROSIntegration/HEAD/Documentation/ue4-setup-03.png -------------------------------------------------------------------------------- /ThirdParty/bson/lib/bson-1.0.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-iai/ROSIntegration/HEAD/ThirdParty/bson/lib/bson-1.0.lib -------------------------------------------------------------------------------- /ThirdParty/bson/lib/libbson-1.0.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-iai/ROSIntegration/HEAD/ThirdParty/bson/lib/libbson-1.0.a -------------------------------------------------------------------------------- /ThirdParty/bson/lib/bson-static-1.0.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-iai/ROSIntegration/HEAD/ThirdParty/bson/lib/bson-static-1.0.lib -------------------------------------------------------------------------------- /ThirdParty/bson/lib/libbson-static-1.0.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-iai/ROSIntegration/HEAD/ThirdParty/bson/lib/libbson-static-1.0.a -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/SpawnObjectMessage.cpp: -------------------------------------------------------------------------------- 1 | #include "SpawnObjectMessage.h" 2 | 3 | SpawnObjectMessage::SpawnObjectMessage() 4 | { 5 | } 6 | 7 | SpawnObjectMessage::~SpawnObjectMessage() 8 | { 9 | } 10 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Public/ROSBaseServiceRequest.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | class ROSINTEGRATION_API FROSBaseServiceRequest { 6 | 7 | public: 8 | FROSBaseServiceRequest() = default; 9 | ~FROSBaseServiceRequest() = default; 10 | }; 11 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Public/ROSBaseMsg.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include "ros_version.h" 5 | 6 | class ROSINTEGRATION_API FROSBaseMsg { 7 | 8 | public: 9 | FROSBaseMsg() = default; 10 | ~FROSBaseMsg() = default; 11 | 12 | FString _MessageType; 13 | }; 14 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Public/ROSBaseServiceResponse.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | class ROSINTEGRATION_API FROSBaseServiceResponse { 6 | 7 | public: 8 | FROSBaseServiceResponse() = default; 9 | ~FROSBaseServiceResponse() = default; 10 | 11 | bool _Result; 12 | }; 13 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Public/std_srvs/TriggerRequest.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include "ROSBaseServiceRequest.h" 5 | 6 | namespace std_srvs { 7 | class ROSINTEGRATION_API FTriggerRequest : public FROSBaseServiceRequest { 8 | 9 | public: 10 | FTriggerRequest() = default; 11 | ~FTriggerRequest() = default; 12 | 13 | }; 14 | } 15 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Public/std_msgs/Bool.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ROSBaseMsg.h" 4 | 5 | namespace ROSMessages{ 6 | namespace std_msgs { 7 | class Bool : public FROSBaseMsg { 8 | public: 9 | Bool() : Bool(false) {} 10 | 11 | Bool(bool data) { 12 | _MessageType = "std_msgs/Bool"; 13 | _Data = data; 14 | } 15 | 16 | //private: 17 | bool _Data; 18 | }; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Public/rospy_tutorials/AddTwoIntsRequest.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include "ROSBaseServiceRequest.h" 5 | 6 | namespace rospy_tutorials { 7 | class ROSINTEGRATION_API FAddTwoIntsRequest : public FROSBaseServiceRequest { 8 | 9 | public: 10 | FAddTwoIntsRequest() = default; 11 | ~FAddTwoIntsRequest() = default; 12 | 13 | int64 _a, _b; 14 | }; 15 | } 16 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Public/rospy_tutorials/AddTwoIntsResponse.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include "ROSBaseServiceResponse.h" 5 | 6 | namespace rospy_tutorials { 7 | class ROSINTEGRATION_API FAddTwoIntsResponse : public FROSBaseServiceResponse { 8 | 9 | public: 10 | FAddTwoIntsResponse() = default; 11 | ~FAddTwoIntsResponse() = default; 12 | 13 | int64 _sum; 14 | }; 15 | } 16 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Public/std_msgs/Empty.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ROSBaseMsg.h" 4 | 5 | namespace ROSMessages{ 6 | namespace std_msgs { 7 | class String : public FROSBaseMsg { 8 | public: 9 | String() { 10 | _MessageType = "std_msgs/Empty"; 11 | } 12 | 13 | String(FString data) { 14 | _MessageType = "std_msgs/Empty"; 15 | } 16 | 17 | //private: 18 | }; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Public/std_msgs/Int32.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ROSBaseMsg.h" 4 | 5 | namespace ROSMessages{ 6 | namespace std_msgs { 7 | class Int32 : public FROSBaseMsg { 8 | public: 9 | Int32() : Int32(0.f) {} 10 | 11 | Int32(float data) { 12 | _MessageType = "std_msgs/Int32"; 13 | _Data = data; 14 | } 15 | 16 | //private: 17 | int32 _Data; 18 | }; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Public/std_msgs/Int64.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ROSBaseMsg.h" 4 | 5 | namespace ROSMessages{ 6 | namespace std_msgs { 7 | class Int64 : public FROSBaseMsg { 8 | public: 9 | Int64() : Int64(0.f) {} 10 | 11 | Int64(int64 data) { 12 | _MessageType = "std_msgs/Int64"; 13 | _Data = data; 14 | } 15 | 16 | //private: 17 | int64 _Data; 18 | }; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Public/std_msgs/UInt8.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ROSBaseMsg.h" 4 | 5 | namespace ROSMessages{ 6 | namespace std_msgs { 7 | class UInt8 : public FROSBaseMsg { 8 | public: 9 | UInt8() : UInt8(0) {} 10 | 11 | UInt8(uint8 data) { 12 | _MessageType = "std_msgs/UInt8"; 13 | _Data = data; 14 | } 15 | 16 | //private: 17 | uint8 _Data; 18 | }; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Config/FilterPlugin.ini: -------------------------------------------------------------------------------- 1 | [FilterPlugin] 2 | ; This section lists additional files which will be packaged along with your plugin. Paths should be listed relative to the root plugin directory, and 3 | ; may include "...", "*", and "?" wildcards to match directories, files, and individual characters respectively. 4 | ; 5 | ; Examples: 6 | ; /README.txt 7 | ; /Extras/... 8 | ; /Binaries/ThirdParty/*.dll 9 | /ThirdParty/... -------------------------------------------------------------------------------- /Source/ROSIntegration/Public/std_srvs/TriggerResponse.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include "ROSBaseServiceResponse.h" 5 | 6 | namespace std_srvs { 7 | class ROSINTEGRATION_API FTriggerResponse : public FROSBaseServiceResponse { 8 | 9 | public: 10 | FTriggerResponse() = default; 11 | ~FTriggerResponse() = default; 12 | 13 | bool _success; 14 | FString _message; 15 | }; 16 | } 17 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Public/std_msgs/Float32.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ROSBaseMsg.h" 4 | 5 | namespace ROSMessages{ 6 | namespace std_msgs { 7 | class Float32 : public FROSBaseMsg { 8 | public: 9 | Float32() : Float32(0.f) {} 10 | 11 | Float32(float data) { 12 | _MessageType = "std_msgs/Float32"; 13 | _Data = data; 14 | } 15 | 16 | //private: 17 | float _Data; 18 | }; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Public/tf2_msgs/TFMessage.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ROSBaseMsg.h" 4 | 5 | #include "geometry_msgs/TransformStamped.h" 6 | 7 | namespace ROSMessages{ 8 | namespace tf2_msgs{ 9 | class TFMessage: public FROSBaseMsg { 10 | public: 11 | TFMessage() { 12 | _MessageType = "tf2_msgs/TFMessage"; 13 | } 14 | TArray transforms; 15 | }; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Public/geometry_msgs/Twist.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ROSBaseMsg.h" 4 | 5 | #include "geometry_msgs/Vector3.h" 6 | 7 | namespace ROSMessages { 8 | namespace geometry_msgs { 9 | class Twist : public FROSBaseMsg { 10 | public: 11 | Twist() { 12 | _MessageType = "geometry_msgs/Twist"; 13 | } 14 | 15 | geometry_msgs::Vector3 linear; 16 | geometry_msgs::Vector3 angular; 17 | }; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Public/std_msgs/String.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ROSBaseMsg.h" 4 | 5 | namespace ROSMessages{ 6 | namespace std_msgs { 7 | class String : public FROSBaseMsg { 8 | public: 9 | String() { 10 | _MessageType = "std_msgs/String"; 11 | } 12 | 13 | String(FString data) { 14 | _MessageType = "std_msgs/String"; 15 | _Data = data; 16 | } 17 | 18 | //private: 19 | FString _Data; 20 | }; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Public/rosgraph_msgs/Clock.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ROSBaseMsg.h" 4 | #include "ROSTime.h" 5 | 6 | namespace ROSMessages { 7 | namespace rosgraph_msgs { 8 | class Clock : public FROSBaseMsg { 9 | public: 10 | Clock() : Clock(FROSTime()) {} 11 | 12 | Clock(FROSTime clock) { 13 | _MessageType = "rosgraph_msgs/Clock"; 14 | _Clock = clock; 15 | } 16 | 17 | //private: 18 | FROSTime _Clock; 19 | }; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Public/sensor_msgs/RegionOfInterest.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ROSBaseMsg.h" 4 | 5 | namespace ROSMessages{ 6 | namespace sensor_msgs { 7 | class RegionOfInterest: public FROSBaseMsg { 8 | public: 9 | RegionOfInterest() { 10 | _MessageType = "sensor_msgs/RegionOfInterest"; 11 | } 12 | 13 | uint32 x_offset; 14 | uint32 y_offset; 15 | uint32 height; 16 | uint32 width; 17 | bool do_rectify; 18 | }; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Public/geometry_msgs/Pose.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ROSBaseMsg.h" 4 | 5 | #include "geometry_msgs/Point.h" 6 | #include "geometry_msgs/Quaternion.h" 7 | 8 | namespace ROSMessages { 9 | namespace geometry_msgs { 10 | class Pose : public FROSBaseMsg { 11 | public: 12 | Pose() { 13 | _MessageType = "geometry_msgs/Pose"; 14 | } 15 | 16 | geometry_msgs::Point position; 17 | geometry_msgs::Quaternion orientation; 18 | }; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Public/geometry_msgs/PoseStamped.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ROSBaseMsg.h" 4 | 5 | #include "geometry_msgs/Pose.h" 6 | #include "std_msgs/Header.h" 7 | 8 | namespace ROSMessages { 9 | namespace geometry_msgs { 10 | class PoseStamped : public FROSBaseMsg { 11 | public: 12 | PoseStamped() { 13 | _MessageType = "geometry_msgs/PoseStamped"; 14 | } 15 | 16 | std_msgs::Header header; 17 | geometry_msgs::Pose pose; 18 | }; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Public/geometry_msgs/TwistStamped.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ROSBaseMsg.h" 4 | 5 | #include "std_msgs/Header.h" 6 | #include "geometry_msgs/Twist.h" 7 | 8 | namespace ROSMessages { 9 | namespace geometry_msgs { 10 | class TwistStamped : public FROSBaseMsg { 11 | public: 12 | TwistStamped() { 13 | _MessageType = "geometry_msgs/TwistStamped"; 14 | } 15 | 16 | std_msgs::Header header; 17 | geometry_msgs::Twist twist; 18 | }; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Public/geometry_msgs/Transform.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ROSBaseMsg.h" 4 | 5 | #include "geometry_msgs/Vector3.h" 6 | #include "geometry_msgs/Quaternion.h" 7 | 8 | namespace ROSMessages{ 9 | namespace geometry_msgs { 10 | class Transform: public FROSBaseMsg { 11 | public: 12 | Transform() { 13 | _MessageType = "geometry_msgs/Transform"; 14 | } 15 | geometry_msgs::Vector3 translation; 16 | geometry_msgs::Quaternion rotation; 17 | }; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/BaseMessageConverter.cpp: -------------------------------------------------------------------------------- 1 | #include "Conversion/Messages/BaseMessageConverter.h" 2 | 3 | 4 | UBaseMessageConverter::UBaseMessageConverter() 5 | { 6 | } 7 | 8 | bool UBaseMessageConverter::ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr &BaseMsg) 9 | { 10 | return false; 11 | } 12 | 13 | bool UBaseMessageConverter::ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message) 14 | { 15 | return false; 16 | } 17 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Public/nav_msgs/Path.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ROSBaseMsg.h" 4 | 5 | #include "std_msgs/Header.h" 6 | #include "geometry_msgs/PoseStamped.h" 7 | 8 | namespace ROSMessages { 9 | namespace nav_msgs { 10 | class Path : public FROSBaseMsg { 11 | public: 12 | Path() { 13 | _MessageType = "nav_msgs/Path"; 14 | } 15 | 16 | // Header header 17 | std_msgs::Header header; 18 | // geometry_msgs / PoseStamped[] poses 19 | TArray poses; 20 | }; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Public/geometry_msgs/TransformStamped.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ROSBaseMsg.h" 4 | 5 | #include "std_msgs/Header.h" 6 | #include "geometry_msgs/Transform.h" 7 | 8 | namespace ROSMessages{ 9 | namespace geometry_msgs { 10 | class TransformStamped: public FROSBaseMsg { 11 | public: 12 | TransformStamped() { 13 | _MessageType = "geometry_msgs/TransformStamped"; 14 | } 15 | 16 | std_msgs::Header header; 17 | FString child_frame_id; 18 | geometry_msgs::Transform transform; 19 | }; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Public/std_msgs/Header.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ROSBaseMsg.h" 4 | #include "ROSTime.h" 5 | 6 | 7 | namespace ROSMessages{ 8 | namespace std_msgs { 9 | class Header: public FROSBaseMsg { 10 | public: 11 | Header() { 12 | _MessageType = "std_msgs/Header"; 13 | } 14 | 15 | Header(uint32 seq, FROSTime time, FString frame_id) : seq(seq), time(time), frame_id(frame_id) { 16 | _MessageType = "std_msgs/Header"; 17 | } 18 | 19 | uint32 seq; 20 | FROSTime time; 21 | FString frame_id; 22 | }; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Public/geometry_msgs/Point.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ROSBaseMsg.h" 4 | 5 | namespace ROSMessages { 6 | namespace geometry_msgs { 7 | class Point : public FROSBaseMsg { 8 | public: 9 | Point() : Point(0, 0, 0) {} 10 | 11 | Point(double x, double y, double z) : x(x), y(y), z(z) { 12 | _MessageType = "geometry_msgs/Point"; 13 | } 14 | 15 | Point(FVector v) : Point(v.X, v.Y, v.Z) {} 16 | 17 | FVector ToFVector() {return FVector(x, y, z);} 18 | 19 | double x; 20 | double y; 21 | double z; 22 | }; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Public/geometry_msgs/Vector3.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ROSBaseMsg.h" 4 | 5 | namespace ROSMessages{ 6 | namespace geometry_msgs { 7 | class Vector3: public FROSBaseMsg { 8 | public: 9 | Vector3() : Vector3(0, 0, 0) {} 10 | 11 | Vector3(double x, double y, double z) : x(x), y(y), z(z) { 12 | _MessageType = "geometry_msgs/Vector3"; 13 | } 14 | 15 | Vector3(FVector v) : Vector3(v.X, v.Y, v.Z) {} 16 | 17 | FVector ToFVector() {return FVector(x, y, z);} 18 | 19 | double x; 20 | double y; 21 | double z; 22 | }; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Public/ROSTime.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | class ROSINTEGRATION_API FROSTime { 5 | public: 6 | FROSTime() : _Sec(0), _NSec(0) {} 7 | 8 | FROSTime(unsigned long Sec, unsigned long Nsec) : _Sec(Sec), _NSec(Nsec) {} 9 | 10 | static FROSTime Now(); 11 | 12 | static void SetUseSimTime(bool bUseSimTime); 13 | static void SetSimTime(const FROSTime& time); 14 | 15 | // Get the time difference from Time1 to Time2 16 | static double GetTimeDelta(const FROSTime& Time1, const FROSTime& Time2); 17 | 18 | unsigned long _Sec; 19 | unsigned long _NSec; 20 | }; 21 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Public/actionlib_msgs/GoalStatusArray.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ROSBaseMsg.h" 4 | #include "GoalStatus.h" 5 | #include "std_msgs/Header.h" 6 | 7 | namespace ROSMessages { 8 | namespace actionlib_msgs { 9 | class GoalStatusArray : public FROSBaseMsg { 10 | public: 11 | GoalStatusArray() { 12 | _MessageType = "actionlib_msgs/GoalStatusArray"; 13 | } 14 | 15 | // # Stores the statuses for goals that are currently being tracked 16 | // # by an action server 17 | std_msgs::Header header; 18 | TArray status_list; 19 | }; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Public/std_msgs/Float32MultiArray.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ROSBaseMsg.h" 4 | 5 | #include "std_msgs/MultiArrayLayout.h" 6 | 7 | // defined at http://docs.ros.org/api/std_msgs/html/msg/Float32MultiArray.html 8 | namespace ROSMessages { 9 | namespace std_msgs { 10 | class Float32MultiArray : public FROSBaseMsg { 11 | public: 12 | Float32MultiArray() { 13 | _MessageType = "std_msgs/Float32MultiArray"; 14 | } 15 | 16 | //# specification of data layout 17 | MultiArrayLayout layout; 18 | 19 | //# array of data 20 | TArray data; 21 | }; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Public/geometry_msgs/PoseWithCovariance.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ROSBaseMsg.h" 4 | 5 | #include "geometry_msgs/Pose.h" 6 | 7 | // http://docs.ros.org/api/geometry_msgs/html/msg/PoseWithCovariance.html 8 | namespace ROSMessages { 9 | namespace geometry_msgs { 10 | class PoseWithCovariance : public FROSBaseMsg { 11 | public: 12 | PoseWithCovariance() { 13 | _MessageType = "geometry_msgs/PoseWithCovariance"; 14 | } 15 | 16 | geometry_msgs::Pose pose; 17 | 18 | // Row-major representation of the 6x6 covariance matrix 19 | TArray covariance; 20 | }; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Public/geometry_msgs/TwistWithCovariance.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ROSBaseMsg.h" 4 | 5 | #include "geometry_msgs/Twist.h" 6 | 7 | // http://docs.ros.org/api/geometry_msgs/html/msg/TwistWithCovariance.html 8 | namespace ROSMessages { 9 | namespace geometry_msgs { 10 | class TwistWithCovariance : public FROSBaseMsg { 11 | public: 12 | TwistWithCovariance() { 13 | _MessageType = "geometry_msgs/TwistWithCovariance"; 14 | } 15 | 16 | geometry_msgs::Twist twist; 17 | 18 | // Row-major representation of the 6x6 covariance matrix 19 | TArray covariance; 20 | }; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Public/std_msgs/MultiArrayLayout.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ROSBaseMsg.h" 4 | 5 | #include "std_msgs/MultiArrayDimension.h" 6 | 7 | // defined at http://docs.ros.org/api/std_msgs/html/msg/MultiArrayLayout.html 8 | namespace ROSMessages { 9 | namespace std_msgs { 10 | class MultiArrayLayout : public FROSBaseMsg { 11 | public: 12 | MultiArrayLayout() { 13 | _MessageType = "std_msgs/MultiArrayLayout"; 14 | } 15 | 16 | //# Array of dimension properties 17 | TArray dim; 18 | 19 | //# padding elements at front of data 20 | uint32 data_offset; 21 | }; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Public/geometry_msgs/Quaternion.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ROSBaseMsg.h" 4 | 5 | namespace ROSMessages{ 6 | namespace geometry_msgs { 7 | class Quaternion: public FROSBaseMsg { 8 | public: 9 | Quaternion() : Quaternion(0, 0, 0, 0) {} 10 | 11 | Quaternion(double x, double y, double z, double w) : x(x), y(y), z(z), w(w){ 12 | _MessageType = "geometry_msgs/Quaternion"; 13 | } 14 | 15 | Quaternion(FQuat q) : Quaternion(q.X, q.Y, q.Z, q.W) {} 16 | 17 | FQuat ToFQuat() {return FQuat(x, y, z, w);} 18 | 19 | double x; 20 | double y; 21 | double z; 22 | double w; 23 | }; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/std_msgs/StdMsgsStringConverter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "CoreMinimal.h" 4 | #include "Conversion/Messages/BaseMessageConverter.h" 5 | #include "std_msgs/String.h" 6 | #include "StdMsgsStringConverter.generated.h" 7 | 8 | 9 | UCLASS() 10 | class ROSINTEGRATION_API UStdMsgsStringConverter: public UBaseMessageConverter 11 | { 12 | GENERATED_BODY() 13 | 14 | public: 15 | UStdMsgsStringConverter(); 16 | virtual bool ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr &BaseMsg); 17 | virtual bool ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message); 18 | }; -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/std_msgs/StdMsgsEmptyConverter.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | 4 | #include "Conversion/Messages/std_msgs/StdMsgsEmptyConverter.h" 5 | 6 | 7 | UStdMsgsEmptyConverter::UStdMsgsEmptyConverter() 8 | { 9 | _MessageType = "std_msgs/Empty"; 10 | } 11 | 12 | bool UStdMsgsEmptyConverter::ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr &BaseMsg) { 13 | 14 | 15 | return true; 16 | } 17 | 18 | bool UStdMsgsEmptyConverter::ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message) { 19 | 20 | return true; 21 | } -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/std_msgs/StdMsgsFloat32Converter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "CoreMinimal.h" 4 | #include "Conversion/Messages/BaseMessageConverter.h" 5 | #include "std_msgs/Float32.h" 6 | #include "StdMsgsFloat32Converter.generated.h" 7 | 8 | 9 | UCLASS() 10 | class ROSINTEGRATION_API UStdMsgsFloat32Converter: public UBaseMessageConverter 11 | { 12 | GENERATED_BODY() 13 | 14 | public: 15 | UStdMsgsFloat32Converter(); 16 | virtual bool ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr &BaseMsg); 17 | virtual bool ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message); 18 | }; -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/std_msgs/StdMsgsInt32Converter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "CoreMinimal.h" 4 | #include "Conversion/Messages/BaseMessageConverter.h" 5 | #include "std_msgs/Int32.h" 6 | #include "StdMsgsInt32Converter.generated.h" 7 | 8 | 9 | UCLASS() 10 | class ROSINTEGRATION_API UStdMsgsInt32Converter: public UBaseMessageConverter 11 | { 12 | GENERATED_BODY() 13 | 14 | public: 15 | UStdMsgsInt32Converter(); 16 | virtual bool ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr &BaseMsg); 17 | virtual bool ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message); 18 | }; 19 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/std_msgs/StdMsgsInt64Converter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "CoreMinimal.h" 4 | #include "Conversion/Messages/BaseMessageConverter.h" 5 | #include "std_msgs/Int64.h" 6 | #include "StdMsgsInt64Converter.generated.h" 7 | 8 | 9 | UCLASS() 10 | class ROSINTEGRATION_API UStdMsgsInt64Converter: public UBaseMessageConverter 11 | { 12 | GENERATED_BODY() 13 | 14 | public: 15 | UStdMsgsInt64Converter(); 16 | virtual bool ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr &BaseMsg); 17 | virtual bool ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message); 18 | }; 19 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/std_msgs/StdMsgsUInt8Converter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include "Conversion/Messages/BaseMessageConverter.h" 5 | #include "std_msgs/UInt8.h" 6 | #include "StdMsgsUInt8Converter.generated.h" 7 | 8 | 9 | UCLASS() 10 | class ROSINTEGRATION_API UStdMsgsUInt8Converter: public UBaseMessageConverter 11 | { 12 | GENERATED_BODY() 13 | 14 | public: 15 | UStdMsgsUInt8Converter(); 16 | virtual bool ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr &BaseMsg); 17 | virtual bool ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message); 18 | }; 19 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Public/sensor_msgs/MagneticField.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ROSBaseMsg.h" 4 | #include "std_msgs/Header.h" 5 | #include "geometry_msgs/Vector3.h" 6 | 7 | // https://docs.ros.org/en/noetic/api/sensor_msgs/html/msg/MagneticField.html 8 | namespace ROSMessages { 9 | namespace sensor_msgs { 10 | class MagneticField : public FROSBaseMsg { 11 | public: 12 | MagneticField() { 13 | _MessageType = "sensor_msgs/MagneticField"; 14 | } 15 | 16 | // Header header 17 | std_msgs::Header header; 18 | 19 | geometry_msgs::Vector3 magnetic_field; 20 | TArray magnetic_field_covariance; 21 | 22 | }; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Public/nav_msgs/OccupancyGrid.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ROSBaseMsg.h" 4 | 5 | #include "std_msgs/Header.h" 6 | #include "nav_msgs/MapMetaData.h" 7 | 8 | namespace ROSMessages { 9 | namespace nav_msgs { 10 | class OccupancyGrid : public FROSBaseMsg { 11 | public: 12 | OccupancyGrid() { 13 | _MessageType = "nav_msgs/OccupancyGrid"; 14 | } 15 | 16 | // Header header 17 | std_msgs::Header header; 18 | 19 | // nav_msgs/MapMetaData info 20 | MapMetaData info; 21 | 22 | // int8[] data 23 | // Note: BSON will coerce the int32 to int8. int8 not implemented in BSON. 24 | TArray data; 25 | }; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /ThirdParty/bson/include/linux/bson-stdint.h: -------------------------------------------------------------------------------- 1 | #ifndef _SRC_BSON_BSON_STDINT_H 2 | #define _SRC_BSON_BSON_STDINT_H 1 3 | #ifndef _GENERATED_STDINT_H 4 | #define _GENERATED_STDINT_H " " 5 | /* generated using a gnu compiler version gcc (Ubuntu 5.4.0-6ubuntu1~16.04.5) 5.4.0 20160609 Copyright (C) 2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ 6 | 7 | #include 8 | 9 | 10 | /* system headers have good uint64_t */ 11 | #ifndef _HAVE_UINT64_T 12 | #define _HAVE_UINT64_T 13 | #endif 14 | 15 | /* once */ 16 | #endif 17 | #endif 18 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Public/std_msgs/MultiArrayDimension.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ROSBaseMsg.h" 4 | 5 | // defined at http://docs.ros.org/api/std_msgs/html/msg/MultiArrayDimension.html 6 | namespace ROSMessages { 7 | namespace std_msgs { 8 | class MultiArrayDimension : public FROSBaseMsg { 9 | public: 10 | MultiArrayDimension() { 11 | _MessageType = "std_msgs/MultiArrayDimension"; 12 | } 13 | 14 | //string label # label of given dimension 15 | FString label; 16 | 17 | //uint32 size # size of given dimension(in type units) 18 | uint32 size; 19 | 20 | //uint32 stride # stride of given dimension 21 | uint32 stride; 22 | }; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Services/BaseRequestConverter.cpp: -------------------------------------------------------------------------------- 1 | #include "Conversion/Services/BaseRequestConverter.h" 2 | 3 | 4 | UBaseRequestConverter::UBaseRequestConverter() 5 | { 6 | } 7 | 8 | 9 | bool UBaseRequestConverter::ConvertOutgoingRequest(TSharedPtr Request, bson_t** BSONRequest) 10 | { 11 | return false; 12 | } 13 | 14 | bool UBaseRequestConverter::ConvertIncomingRequest(ROSBridgeCallServiceMsg &req, TSharedPtr Request) 15 | { 16 | return false; 17 | } 18 | 19 | TSharedPtr UBaseRequestConverter::AllocateConcreteRequest() 20 | { 21 | return TSharedPtr(); 22 | } 23 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Services/BaseResponseConverter.cpp: -------------------------------------------------------------------------------- 1 | #include "Conversion/Services/BaseResponseConverter.h" 2 | 3 | 4 | UBaseResponseConverter::UBaseResponseConverter() 5 | { 6 | } 7 | 8 | bool UBaseResponseConverter::ConvertIncomingResponse(const ROSBridgeServiceResponseMsg &res, TSharedRef> Response) 9 | { 10 | return false; 11 | } 12 | 13 | bool UBaseResponseConverter::ConvertOutgoingResponse(TSharedPtr Response, ROSBridgeServiceResponseMsg &res) 14 | { 15 | return false; 16 | } 17 | 18 | TSharedPtr UBaseResponseConverter::AllocateConcreteResponse() 19 | { 20 | return TSharedPtr(); 21 | } 22 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/std_msgs/StdMsgsBoolConverter.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | #include "Conversion/Messages/BaseMessageConverter.h" 7 | #include "std_msgs/Bool.h" 8 | #include "StdMsgsBoolConverter.generated.h" 9 | 10 | 11 | UCLASS() 12 | class ROSINTEGRATION_API UStdMsgsBoolConverter : public UBaseMessageConverter 13 | { 14 | GENERATED_BODY() 15 | 16 | public: 17 | UStdMsgsBoolConverter(); 18 | virtual bool ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr &BaseMsg); 19 | virtual bool ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message); 20 | 21 | }; -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/std_msgs/StdMsgsEmptyConverter.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | #include "Conversion/Messages/BaseMessageConverter.h" 7 | #include "std_msgs/Bool.h" 8 | #include "StdMsgsEmptyConverter.generated.h" 9 | 10 | 11 | UCLASS() 12 | class ROSINTEGRATION_API UStdMsgsEmptyConverter : public UBaseMessageConverter 13 | { 14 | GENERATED_BODY() 15 | 16 | public: 17 | UStdMsgsEmptyConverter(); 18 | virtual bool ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr &BaseMsg); 19 | virtual bool ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message); 20 | 21 | }; -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/rosbridge2cpp/ros_time.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace rosbridge2cpp { 5 | /** 6 | * A class that contains the same time format like the original ROSTime. 7 | * 8 | * sec_ contains the seconds sind 1.1.1970. 9 | * nsec_ contains the rest nanoseconds from sec_ up to the given time 10 | */ 11 | class ROSTime { 12 | public: 13 | ROSTime() = default; 14 | ROSTime(unsigned long sec, unsigned long nsec) : sec_(sec), nsec_(nsec) {} 15 | 16 | static ROSTime now(); 17 | 18 | unsigned long sec_; 19 | unsigned long nsec_; 20 | 21 | static bool use_sim_time; 22 | static ROSTime sim_time; 23 | 24 | static const std::chrono::high_resolution_clock::duration HRCEpocOffset; 25 | }; 26 | } 27 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/ROSIntegration.cpp: -------------------------------------------------------------------------------- 1 | #include "ROSIntegration.h" 2 | 3 | #define LOCTEXT_NAMESPACE "FROSIntegrationModule" 4 | 5 | void FROSIntegrationModule::StartupModule() 6 | { 7 | // This code will execute after your module is loaded into memory; the exact timing is specified in the .uplugin file per-module 8 | } 9 | 10 | void FROSIntegrationModule::ShutdownModule() 11 | { 12 | // This function may be called during shutdown to clean up your module. For modules that support dynamic reloading, 13 | // we call this function before unloading the module. 14 | } 15 | 16 | #undef LOCTEXT_NAMESPACE 17 | 18 | // IMPLEMENT_MODULE(FROSIntegrationModule, ROSIntegration) 19 | IMPLEMENT_PRIMARY_GAME_MODULE( FDefaultGameModuleImpl, ROSIntegration, "ROSIntegration" ) -------------------------------------------------------------------------------- /Source/ROSIntegration/Public/actionlib_msgs/GoalID.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ROSBaseMsg.h" 4 | #include "ROSTime.h" 5 | 6 | namespace ROSMessages { 7 | namespace actionlib_msgs { 8 | class GoalID : public FROSBaseMsg { 9 | public: 10 | GoalID() { 11 | _MessageType = "actionlib_msgs/GoalID"; 12 | } 13 | 14 | // # The stamp should store the time at which this goal was requested. 15 | // # It is used by an action server when it tries to preempt all 16 | // # goals that were requested before a certain time 17 | FROSTime stamp; 18 | 19 | // # The id provides a way to associate feedback and 20 | // # result message with specific goal requests. The id 21 | // # specified must be unique. 22 | FString id; 23 | }; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Public/nav_msgs/Odometry.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ROSBaseMsg.h" 4 | 5 | #include "std_msgs/Header.h" 6 | #include "geometry_msgs/PoseWithCovariance.h" 7 | #include "geometry_msgs/TwistWithCovariance.h" 8 | 9 | namespace ROSMessages { 10 | namespace nav_msgs { 11 | class Odometry : public FROSBaseMsg { 12 | public: 13 | Odometry() { 14 | _MessageType = "nav_msgs/Odometry"; 15 | } 16 | 17 | // Header header 18 | std_msgs::Header header; 19 | // string child_frame_id 20 | FString child_frame_id; 21 | // geometry_msgs / PoseWithCovariance pose 22 | geometry_msgs::PoseWithCovariance pose; 23 | // geometry_msgs / TwistWithCovariance twist 24 | geometry_msgs::TwistWithCovariance twist; 25 | }; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Public/std_msgs/ColorRGBA.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ROSBaseMsg.h" 4 | 5 | namespace ROSMessages{ 6 | namespace std_msgs { 7 | class ColorRGBA : public FROSBaseMsg { 8 | public: 9 | ColorRGBA() : ColorRGBA(0.f, 0.f, 0.f) {} 10 | 11 | ColorRGBA(float InR, float InG, float InB, float InA = 1.) { 12 | _MessageType = "std_msgs/ColorRGBA"; 13 | r = InR; 14 | g = InG; 15 | b = InB; 16 | a = InA; 17 | } 18 | 19 | ColorRGBA(FLinearColor Color) : ColorRGBA(Color.R, Color.G, Color.B, Color.A) {} 20 | 21 | FLinearColor ToFLinearColor() {return FLinearColor(r,g,b,a);} 22 | 23 | // All values should be in the normalized range [0,1] 24 | float r; 25 | float g; 26 | float b; 27 | float a; 28 | }; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Services/std_srvs/StdSrvsTriggerRequestConverter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "CoreMinimal.h" 4 | #include "Conversion/Services/BaseRequestConverter.h" 5 | 6 | #include "StdSrvsTriggerRequestConverter.generated.h" 7 | 8 | 9 | UCLASS() 10 | class ROSINTEGRATION_API UStdSrvsTriggerRequestConverter: public UBaseRequestConverter 11 | { 12 | GENERATED_BODY() 13 | 14 | public: 15 | UStdSrvsTriggerRequestConverter(); 16 | virtual bool ConvertIncomingRequest(ROSBridgeCallServiceMsg &req, TSharedPtr Request) override; 17 | virtual bool ConvertOutgoingRequest(TSharedPtr Request, bson_t** BSONRequest) override; 18 | 19 | virtual TSharedPtr AllocateConcreteRequest() override; 20 | }; -------------------------------------------------------------------------------- /ROSIntegration.uplugin: -------------------------------------------------------------------------------- 1 | { 2 | "FileVersion": 3, 3 | "Version": 1, 4 | "VersionName": "1.0", 5 | "FriendlyName": "ROS Integration", 6 | "Description": "Adds ROS support without adding ROS dependencies.", 7 | "Category": "Simulation", 8 | "CreatedBy": "Institute for Artificial Intelligence - University of Bremen", 9 | "CreatedByURL": "https://github.com/code-iai/ROSIntegration", 10 | "DocsURL": "https://github.com/code-iai/ROSIntegration", 11 | "MarketplaceURL": "", 12 | "SupportURL": "https://github.com/code-iai/ROSIntegration", 13 | "CanContainContent": false, 14 | "IsBetaVersion": false, 15 | "Installed": true, 16 | "EnabledByDefault": true, 17 | "Modules": [ 18 | { 19 | "Name": "ROSIntegration", 20 | "Type": "Runtime", 21 | "LoadingPhase": "Default" 22 | } 23 | ] 24 | } 25 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Public/std_msgs/UInt8MultiArray.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ROSBaseMsg.h" 4 | 5 | #include "std_msgs/MultiArrayLayout.h" 6 | 7 | // defined at http://docs.ros.org/api/std_msgs/html/msg/Float32MultiArray.html 8 | namespace ROSMessages { 9 | namespace std_msgs { 10 | class UInt8MultiArray : public FROSBaseMsg { 11 | public: 12 | UInt8MultiArray() { 13 | _MessageType = "std_msgs/UInt8MultiArray"; 14 | } 15 | 16 | //# specification of data layout 17 | MultiArrayLayout layout; 18 | 19 | // To avoid copy operations of the image data, 20 | // hand over a pointer to the uint8 data. 21 | // Please note, that the memory this pointer points to must be valid until this message has been published. 22 | const uint8* data; 23 | }; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Services/std_srvs/StdSrvsTriggerResponseConverter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "CoreMinimal.h" 4 | #include "Conversion/Services/BaseResponseConverter.h" 5 | #include "StdSrvsTriggerResponseConverter.generated.h" 6 | 7 | 8 | UCLASS() 9 | class ROSINTEGRATION_API UStdSrvsTriggerResponseConverter: public UBaseResponseConverter 10 | { 11 | GENERATED_BODY() 12 | 13 | public: 14 | UStdSrvsTriggerResponseConverter(); 15 | virtual bool ConvertIncomingResponse(const ROSBridgeServiceResponseMsg &res, TSharedRef> Response) override; 16 | virtual bool ConvertOutgoingResponse(TSharedPtr Response, ROSBridgeServiceResponseMsg &res) override; 17 | 18 | virtual TSharedPtr AllocateConcreteResponse() override; 19 | }; -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Services/rospy_tutorials/RospyTutorialsAddTwoIntsRequestConverter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "CoreMinimal.h" 4 | #include "Conversion/Services/BaseRequestConverter.h" 5 | 6 | #include "RospyTutorialsAddTwoIntsRequestConverter.generated.h" 7 | 8 | 9 | UCLASS() 10 | class ROSINTEGRATION_API URospyTutorialsAddTwoIntsRequestConverter: public UBaseRequestConverter 11 | { 12 | GENERATED_BODY() 13 | 14 | public: 15 | URospyTutorialsAddTwoIntsRequestConverter(); 16 | virtual bool ConvertIncomingRequest(ROSBridgeCallServiceMsg &req, TSharedPtr Request) override; 17 | virtual bool ConvertOutgoingRequest(TSharedPtr Request, bson_t** BSONRequest) override; 18 | 19 | virtual TSharedPtr AllocateConcreteRequest() override; 20 | }; -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/nav_msgs/NavMsgsPathConverter.cpp: -------------------------------------------------------------------------------- 1 | #include "Conversion/Messages/nav_msgs/NavMsgsPathConverter.h" 2 | 3 | 4 | UNavMsgsPathConverter::UNavMsgsPathConverter() 5 | { 6 | _MessageType = "nav_msgs/Path"; 7 | } 8 | 9 | bool UNavMsgsPathConverter::ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr &BaseMsg) 10 | { 11 | auto msg = new ROSMessages::nav_msgs::Path(); 12 | BaseMsg = TSharedPtr(msg); 13 | return _bson_extract_child_path(message->full_msg_bson_, "msg", msg); 14 | } 15 | 16 | bool UNavMsgsPathConverter::ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message) 17 | { 18 | auto CastMsg = StaticCastSharedPtr(BaseMsg); 19 | *message = bson_new(); 20 | _bson_append_path(*message, CastMsg.Get()); 21 | return true; 22 | } -------------------------------------------------------------------------------- /Source/ROSIntegration/Public/sensor_msgs/Imu.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ROSBaseMsg.h" 4 | #include "std_msgs/Header.h" 5 | #include "geometry_msgs/Quaternion.h" 6 | #include "geometry_msgs/Vector3.h" 7 | 8 | // http://docs.ros.org/melodic/api/sensor_msgs/html/msg/Imu.html 9 | namespace ROSMessages { 10 | namespace sensor_msgs { 11 | class Imu : public FROSBaseMsg { 12 | public: 13 | Imu() { 14 | _MessageType = "sensor_msgs/Imu"; 15 | } 16 | 17 | // Header header 18 | std_msgs::Header header; 19 | 20 | geometry_msgs::Quaternion orientation; 21 | TArray orientation_covariance; 22 | 23 | geometry_msgs::Vector3 angular_velocity; 24 | TArray angular_velocity_covariance; 25 | 26 | geometry_msgs::Vector3 linear_acceleration; 27 | TArray linear_acceleration_covariance; 28 | }; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Services/BaseRequestConverter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "CoreMinimal.h" 4 | #include "rosbridge2cpp/messages/rosbridge_call_service_msg.h" 5 | #include "ROSBaseServiceRequest.h" 6 | #include "Conversion/Messages/BaseMessageConverter.h" 7 | #include "BaseRequestConverter.generated.h" 8 | 9 | 10 | UCLASS() 11 | class ROSINTEGRATION_API UBaseRequestConverter: public UBaseMessageConverter 12 | { 13 | GENERATED_BODY() 14 | 15 | public: 16 | UBaseRequestConverter(); 17 | 18 | UPROPERTY() 19 | FString _ServiceType; 20 | 21 | virtual bool ConvertIncomingRequest(ROSBridgeCallServiceMsg &req, TSharedPtr Request); 22 | virtual bool ConvertOutgoingRequest(TSharedPtr Request, bson_t** BSONRequest); 23 | 24 | virtual TSharedPtr AllocateConcreteRequest(); 25 | }; -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Services/rospy_tutorials/RospyTutorialsAddTwoIntsResponseConverter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "CoreMinimal.h" 4 | #include "Conversion/Services/BaseResponseConverter.h" 5 | #include "RospyTutorialsAddTwoIntsResponseConverter.generated.h" 6 | 7 | 8 | UCLASS() 9 | class ROSINTEGRATION_API URospyTutorialsAddTwoIntsResponseConverter: public UBaseResponseConverter 10 | { 11 | GENERATED_BODY() 12 | 13 | public: 14 | URospyTutorialsAddTwoIntsResponseConverter(); 15 | virtual bool ConvertIncomingResponse(const ROSBridgeServiceResponseMsg &res, TSharedRef> Response) override; 16 | virtual bool ConvertOutgoingResponse(TSharedPtr Response, ROSBridgeServiceResponseMsg &res) override; 17 | 18 | virtual TSharedPtr AllocateConcreteResponse() override; 19 | }; -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/std_msgs/StdMsgsHeaderConverter.cpp: -------------------------------------------------------------------------------- 1 | #include "Conversion/Messages/std_msgs/StdMsgsHeaderConverter.h" 2 | 3 | 4 | UStdMsgsHeaderConverter::UStdMsgsHeaderConverter() 5 | { 6 | _MessageType = "std_msgs/Header"; 7 | } 8 | 9 | bool UStdMsgsHeaderConverter::ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr &BaseMsg) 10 | { 11 | auto msg = new ROSMessages::std_msgs::Header(); 12 | BaseMsg = TSharedPtr(msg); 13 | return _bson_extract_child_header(message->full_msg_bson_, "msg", msg); 14 | } 15 | 16 | bool UStdMsgsHeaderConverter::ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message) 17 | { 18 | auto CastMsg = StaticCastSharedPtr(BaseMsg); 19 | *message = bson_new(); 20 | _bson_append_header(*message, CastMsg.Get()); 21 | return true; 22 | } -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/sensor_msgs/SensorMsgsImuConverter.cpp: -------------------------------------------------------------------------------- 1 | #include "Conversion/Messages/sensor_msgs/SensorMsgsImuConverter.h" 2 | 3 | 4 | USensorMsgsImuConverter::USensorMsgsImuConverter() 5 | { 6 | _MessageType = "sensor_msgs/Imu"; 7 | } 8 | 9 | bool USensorMsgsImuConverter::ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr &BaseMsg) 10 | { 11 | auto msg = new ROSMessages::sensor_msgs::Imu(); 12 | BaseMsg = TSharedPtr(msg); 13 | return _bson_extract_child_imu(message->full_msg_bson_, "msg", msg); 14 | } 15 | 16 | bool USensorMsgsImuConverter::ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message) 17 | { 18 | auto CastMsg = StaticCastSharedPtr(BaseMsg); 19 | *message = bson_new(); 20 | _bson_append_imu(*message, CastMsg.Get()); 21 | return true; 22 | } 23 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Public/sensor_msgs/CameraInfo.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ROSBaseMsg.h" 4 | #include "std_msgs/Header.h" 5 | #include "RegionOfInterest.h" 6 | 7 | 8 | namespace ROSMessages{ 9 | namespace sensor_msgs { 10 | class CameraInfo: public FROSBaseMsg { 11 | public: 12 | CameraInfo() { 13 | _MessageType = "sensor_msgs/CameraInfo"; 14 | D.Init(0,5); // The size of D is undefined in the camera info as it may need changes. We'll start with 5. 15 | K.Init(0,9); 16 | R.Init(0,9); 17 | P.Init(0,12); 18 | } 19 | 20 | ROSMessages::std_msgs::Header header; 21 | uint32 height; 22 | uint32 width; 23 | FString distortion_model; 24 | TArray D; 25 | TArray K; 26 | TArray R; 27 | TArray P; 28 | uint32 binning_x; 29 | uint32 binning_y; 30 | RegionOfInterest roi; 31 | }; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/rosgraph_msgs/ROSGraphMsgsClockConverter.cpp: -------------------------------------------------------------------------------- 1 | #include "ROSGraphMsgsClockConverter.h" 2 | 3 | 4 | UROSGraphMsgsClockConverter::UROSGraphMsgsClockConverter() 5 | { 6 | _MessageType = "rosgraph_msgs/Clock"; 7 | } 8 | 9 | bool UROSGraphMsgsClockConverter::ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr &BaseMsg) 10 | { 11 | auto msg = new ROSMessages::rosgraph_msgs::Clock(); 12 | BaseMsg = TSharedPtr(msg); 13 | return _bson_extract_child_clock(message->full_msg_bson_, "msg", msg); 14 | } 15 | 16 | bool UROSGraphMsgsClockConverter::ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message) 17 | { 18 | auto CastMsg = StaticCastSharedPtr(BaseMsg); 19 | *message = bson_new(); 20 | _bson_append_clock(*message, CastMsg.Get()); 21 | return true; 22 | } -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/grid_map_msgs/GridMapMsgsGridMapConverter.cpp: -------------------------------------------------------------------------------- 1 | #include "GridMapMsgsGridMapConverter.h" 2 | 3 | UGridMapMsgsGridMapConverter::UGridMapMsgsGridMapConverter() 4 | { 5 | _MessageType = "grid_map_msgs/GridMap"; 6 | } 7 | 8 | bool UGridMapMsgsGridMapConverter::ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr &BaseMsg) 9 | { 10 | auto msg = new ROSMessages::grid_map_msgs::GridMap; 11 | BaseMsg = TSharedPtr(msg); 12 | return _bson_extract_child_grid_map(message->full_msg_bson_, "msg", msg); 13 | } 14 | 15 | bool UGridMapMsgsGridMapConverter::ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message) 16 | { 17 | auto CastMsg = StaticCastSharedPtr(BaseMsg); 18 | *message = bson_new(); 19 | _bson_append_grid_map(*message, CastMsg.Get()); 20 | return true; 21 | } -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/nav_msgs/NavMsgsOdometryConverter.cpp: -------------------------------------------------------------------------------- 1 | #include "Conversion/Messages/nav_msgs/NavMsgsOdometryConverter.h" 2 | 3 | 4 | UNavMsgsOdometryConverter::UNavMsgsOdometryConverter() 5 | { 6 | _MessageType = "nav_msgs/Odometry"; 7 | } 8 | 9 | bool UNavMsgsOdometryConverter::ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr &BaseMsg) 10 | { 11 | auto msg = new ROSMessages::nav_msgs::Odometry(); 12 | BaseMsg = TSharedPtr(msg); 13 | return _bson_extract_child_odometry(message->full_msg_bson_, "msg", msg); 14 | } 15 | 16 | bool UNavMsgsOdometryConverter::ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message) 17 | { 18 | auto CastMsg = StaticCastSharedPtr(BaseMsg); 19 | *message = bson_new(); 20 | _bson_append_odometry(*message, CastMsg.Get()); 21 | return true; 22 | } -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/sensor_msgs/SensorMsgsImageConverter.cpp: -------------------------------------------------------------------------------- 1 | #include "Conversion/Messages/sensor_msgs/SensorMsgsImageConverter.h" 2 | 3 | 4 | USensorMsgsImageConverter::USensorMsgsImageConverter() 5 | { 6 | _MessageType = "sensor_msgs/Image"; 7 | } 8 | 9 | bool USensorMsgsImageConverter::ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr &BaseMsg) 10 | { 11 | auto msg = new ROSMessages::sensor_msgs::Image; 12 | BaseMsg = TSharedPtr(msg); 13 | return _bson_extract_child_image(message->full_msg_bson_, "msg", msg); 14 | } 15 | 16 | bool USensorMsgsImageConverter::ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message) 17 | { 18 | auto CastMsg = StaticCastSharedPtr(BaseMsg); 19 | *message = bson_new(); 20 | _bson_append_image(*message, CastMsg.Get()); 21 | return true; 22 | } -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/nav_msgs/NavMsgsMapMetaDataConverter.cpp: -------------------------------------------------------------------------------- 1 | #include "NavMsgsMapMetaDataConverter.h" 2 | 3 | 4 | UNavMsgsMapMetaDataConverter::UNavMsgsMapMetaDataConverter() 5 | { 6 | _MessageType = "nav_msgs/MapMetaData"; 7 | } 8 | 9 | bool UNavMsgsMapMetaDataConverter::ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr &BaseMsg) 10 | { 11 | auto msg = new ROSMessages::nav_msgs::MapMetaData; 12 | BaseMsg = TSharedPtr(msg); 13 | return _bson_extract_child_map_meta_data(message->full_msg_bson_, "msg", msg); 14 | } 15 | 16 | bool UNavMsgsMapMetaDataConverter::ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message) 17 | { 18 | auto CastMsg = StaticCastSharedPtr(BaseMsg); 19 | *message = bson_new(); 20 | _bson_append_map_meta_data(*message, CastMsg.Get()); 21 | return true; 22 | } -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/geometry_msgs/GeometryMsgsPoseConverter.cpp: -------------------------------------------------------------------------------- 1 | #include "Conversion/Messages/geometry_msgs/GeometryMsgsPoseConverter.h" 2 | 3 | 4 | UGeometryMsgsPoseConverter::UGeometryMsgsPoseConverter() 5 | { 6 | _MessageType = "geometry_msgs/Pose"; 7 | } 8 | 9 | bool UGeometryMsgsPoseConverter::ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr &BaseMsg) 10 | { 11 | auto msg = new ROSMessages::geometry_msgs::Pose(); 12 | BaseMsg = TSharedPtr(msg); 13 | return _bson_extract_child_pose(message->full_msg_bson_, "msg", msg); 14 | } 15 | 16 | bool UGeometryMsgsPoseConverter::ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message) 17 | { 18 | auto CastMSG = StaticCastSharedPtr(BaseMsg); 19 | *message = bson_new(); 20 | _bson_append_pose(*message, CastMSG.Get()); 21 | return true; 22 | } 23 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/std_msgs/StdMsgsColorRGBAConverter.cpp: -------------------------------------------------------------------------------- 1 | #include "Conversion/Messages/std_msgs/StdMsgsColorRGBAConverter.h" 2 | 3 | 4 | UStdMsgsColorRGBAConverter::UStdMsgsColorRGBAConverter() 5 | { 6 | _MessageType = "std_msgs/ColorRGBA"; 7 | } 8 | 9 | bool UStdMsgsColorRGBAConverter::ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr &BaseMsg) 10 | { 11 | auto msg = new ROSMessages::std_msgs::ColorRGBA(); 12 | BaseMsg = TSharedPtr(msg); 13 | return _bson_extract_child_color_rgba(message->full_msg_bson_, "msg", msg); 14 | } 15 | 16 | bool UStdMsgsColorRGBAConverter::ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message) 17 | { 18 | auto CastMsg = StaticCastSharedPtr(BaseMsg); 19 | *message = bson_new(); 20 | _bson_append_color_rgba(*message, CastMsg.Get()); 21 | return true; 22 | } -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/geometry_msgs/GeometryMsgsTwistConverter.cpp: -------------------------------------------------------------------------------- 1 | #include "Conversion/Messages/geometry_msgs/GeometryMsgsTwistConverter.h" 2 | 3 | 4 | UGeometryMsgsTwistConverter::UGeometryMsgsTwistConverter() 5 | { 6 | _MessageType = "geometry_msgs/Twist"; 7 | } 8 | 9 | bool UGeometryMsgsTwistConverter::ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr &BaseMsg) 10 | { 11 | auto msg = new ROSMessages::geometry_msgs::Twist(); 12 | BaseMsg = TSharedPtr(msg); 13 | return _bson_extract_child_twist(message->full_msg_bson_, "msg", msg); 14 | } 15 | 16 | bool UGeometryMsgsTwistConverter::ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message) 17 | { 18 | auto CastMsg = StaticCastSharedPtr(BaseMsg); 19 | *message = bson_new(); 20 | _bson_append_twist(*message, CastMsg.Get()); 21 | return true; 22 | } -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/geometry_msgs/GeometryMsgsVector3Converter.cpp: -------------------------------------------------------------------------------- 1 | #include "Conversion/Messages/geometry_msgs/GeometryMsgsVector3Converter.h" 2 | 3 | UGeometryMsgsVector3Converter::UGeometryMsgsVector3Converter() 4 | { 5 | _MessageType = "geometry_msgs/Vector3"; 6 | } 7 | 8 | bool UGeometryMsgsVector3Converter::ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr &BaseMsg) 9 | { 10 | auto msg = new ROSMessages::geometry_msgs::Vector3(); 11 | BaseMsg = TSharedPtr(msg); 12 | return _bson_extract_child_vector3(message->full_msg_bson_, "msg", msg); 13 | } 14 | 15 | bool UGeometryMsgsVector3Converter::ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message) 16 | { 17 | auto CastMsg = StaticCastSharedPtr(BaseMsg); 18 | *message = bson_new(); 19 | _bson_append_vector3(*message, CastMsg.Get()); 20 | return true; 21 | } -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/actionlib_msgs/ActionlibMsgsGoalIDConverter.cpp: -------------------------------------------------------------------------------- 1 | #include "Conversion/Messages/actionlib_msgs/ActionlibMsgsGoalIDConverter.h" 2 | 3 | 4 | UActionlibMsgsGoalIDConverter::UActionlibMsgsGoalIDConverter() 5 | { 6 | _MessageType = "actionlib_msgs/GoalID"; 7 | } 8 | 9 | bool UActionlibMsgsGoalIDConverter::ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr &BaseMsg) 10 | { 11 | auto msg = new ROSMessages::actionlib_msgs::GoalID(); 12 | BaseMsg = TSharedPtr(msg); 13 | return _bson_extract_child_goal_id(message->full_msg_bson_, "msg", msg); 14 | } 15 | 16 | bool UActionlibMsgsGoalIDConverter::ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message) 17 | { 18 | auto CastMSG = StaticCastSharedPtr(BaseMsg); 19 | *message = bson_new(); 20 | _bson_append_goal_id(*message, CastMSG.Get()); 21 | return true; 22 | } 23 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/grid_map_msgs/GridMapMsgsGridMapInfoConverter.cpp: -------------------------------------------------------------------------------- 1 | #include "GridMapMsgsGridMapInfoConverter.h" 2 | 3 | 4 | UGridMapMsgsGridMapInfoConverter::UGridMapMsgsGridMapInfoConverter() 5 | { 6 | _MessageType = "grid_map_msgs/GridMapInfo"; 7 | } 8 | 9 | bool UGridMapMsgsGridMapInfoConverter::ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr &BaseMsg) 10 | { 11 | auto msg = new ROSMessages::grid_map_msgs::GridMapInfo; 12 | BaseMsg = TSharedPtr(msg); 13 | return _bson_extract_child_grid_map_info(message->full_msg_bson_, "msg", msg); 14 | } 15 | 16 | bool UGridMapMsgsGridMapInfoConverter::ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message) 17 | { 18 | auto CastMsg = StaticCastSharedPtr(BaseMsg); 19 | *message = bson_new(); 20 | _bson_append_grid_map_info(*message, CastMsg.Get()); 21 | return true; 22 | } -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/sensor_msgs/SensorMsgsLaserScanConverter.cpp: -------------------------------------------------------------------------------- 1 | #include "Conversion/Messages/sensor_msgs/SensorMsgsLaserScanConverter.h" 2 | 3 | 4 | USensorMsgsLaserScanConverter::USensorMsgsLaserScanConverter() 5 | { 6 | _MessageType = "sensor_msgs/LaserScan"; 7 | } 8 | 9 | bool USensorMsgsLaserScanConverter::ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr &BaseMsg) 10 | { 11 | auto msg = new ROSMessages::sensor_msgs::LaserScan; 12 | BaseMsg = TSharedPtr(msg); 13 | return _bson_extract_child_laser_scan(message->full_msg_bson_, "msg", msg); 14 | } 15 | 16 | bool USensorMsgsLaserScanConverter::ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message) 17 | { 18 | auto CastMsg = StaticCastSharedPtr(BaseMsg); 19 | *message = bson_new(); 20 | _bson_append_laser_scan(*message, CastMsg.Get()); 21 | return true; 22 | } 23 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/nav_msgs/NavMsgsOccupancyGridConverter.cpp: -------------------------------------------------------------------------------- 1 | #include "Conversion/Messages/nav_msgs/NavMsgsOccupancyGridConverter.h" 2 | 3 | 4 | UNavMsgsOccupancyGridConverter::UNavMsgsOccupancyGridConverter() 5 | { 6 | _MessageType = "nav_msgs/OccupancyGrid"; 7 | } 8 | 9 | bool UNavMsgsOccupancyGridConverter::ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr &BaseMsg) 10 | { 11 | auto msg = new ROSMessages::nav_msgs::OccupancyGrid(); 12 | BaseMsg = TSharedPtr(msg); 13 | return _bson_extract_child_occupancy_grid(message->full_msg_bson_, "msg", msg); 14 | } 15 | 16 | bool UNavMsgsOccupancyGridConverter::ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message) 17 | { 18 | auto CastMsg = StaticCastSharedPtr(BaseMsg); 19 | *message = bson_new(); 20 | _bson_append_occupancy_grid(*message, CastMsg.Get()); 21 | return true; 22 | } -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/sensor_msgs/SensorMsgsNavSatFixConverter.cpp: -------------------------------------------------------------------------------- 1 | #include "Conversion/Messages/sensor_msgs/SensorMsgsNavSatFixConverter.h" 2 | 3 | 4 | USensorMsgsNavSatFixConverter::USensorMsgsNavSatFixConverter() 5 | { 6 | _MessageType = "sensor_msgs/NavSatFix"; 7 | } 8 | 9 | bool USensorMsgsNavSatFixConverter::ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr &BaseMsg) 10 | { 11 | auto msg = new ROSMessages::sensor_msgs::NavSatFix(); 12 | BaseMsg = TSharedPtr(msg); 13 | return _bson_extract_child_nav_sat_fix(message->full_msg_bson_, "msg", msg); 14 | 15 | } 16 | 17 | bool USensorMsgsNavSatFixConverter::ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message) 18 | { 19 | auto CastMsg = StaticCastSharedPtr(BaseMsg); 20 | *message = bson_new(); 21 | _bson_append_nav_sat_fix(*message, CastMsg.Get()); 22 | return true; 23 | } -------------------------------------------------------------------------------- /Source/ROSIntegration/Public/grid_map_msgs/GridMapInfo.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ROSBaseMsg.h" 4 | 5 | #include "std_msgs/Header.h" 6 | #include "geometry_msgs/Pose.h" 7 | 8 | namespace ROSMessages { 9 | namespace grid_map_msgs { 10 | class GridMapInfo : public FROSBaseMsg { 11 | public: 12 | GridMapInfo() { 13 | _MessageType = "grid_map_msgs/GridMapInfo"; 14 | } 15 | 16 | //# Header(time and frame) 17 | //Header header 18 | std_msgs::Header header; 19 | 20 | //# Resolution of the grid[m / cell]. 21 | //float64 resolution 22 | double resolution; 23 | 24 | //# Length in x - direction[m]. 25 | //float64 length_x 26 | double length_x; 27 | 28 | //# Length in y - direction[m]. 29 | //float64 length_y 30 | double length_y; 31 | 32 | //# Pose of the grid map center in the frame defined in `header`[m]. 33 | //geometry_msgs / Pose pose 34 | geometry_msgs::Pose pose; 35 | }; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/std_msgs/StdMsgsInt32Converter.cpp: -------------------------------------------------------------------------------- 1 | #include "Conversion/Messages/std_msgs/StdMsgsInt32Converter.h" 2 | 3 | 4 | UStdMsgsInt32Converter::UStdMsgsInt32Converter() 5 | { 6 | _MessageType = "std_msgs/Int32"; 7 | } 8 | 9 | bool UStdMsgsInt32Converter::ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr &BaseMsg) { 10 | bool KeyFound = false; 11 | 12 | int32 Data = GetInt32FromBSON(TEXT("msg.data"), message->full_msg_bson_, KeyFound); 13 | if (!KeyFound) return false; 14 | 15 | BaseMsg = TSharedPtr(new ROSMessages::std_msgs::Int32(Data)); 16 | return true; 17 | } 18 | 19 | bool UStdMsgsInt32Converter::ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message) { 20 | auto Int32Message = StaticCastSharedPtr(BaseMsg); 21 | *message = BCON_NEW( 22 | "data", BCON_INT32(Int32Message->_Data) 23 | ); 24 | return true; 25 | } 26 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/std_msgs/StdMsgsInt64Converter.cpp: -------------------------------------------------------------------------------- 1 | #include "Conversion/Messages/std_msgs/StdMsgsInt64Converter.h" 2 | 3 | 4 | UStdMsgsInt64Converter::UStdMsgsInt64Converter() 5 | { 6 | _MessageType = "std_msgs/Int64"; 7 | } 8 | 9 | bool UStdMsgsInt64Converter::ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr &BaseMsg) { 10 | bool KeyFound = false; 11 | 12 | int64 Data = GetInt64FromBSON(TEXT("msg.data"), message->full_msg_bson_, KeyFound); 13 | if (!KeyFound) return false; 14 | 15 | BaseMsg = TSharedPtr(new ROSMessages::std_msgs::Int64(Data)); 16 | return true; 17 | } 18 | 19 | bool UStdMsgsInt64Converter::ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message) { 20 | auto Int64Message = StaticCastSharedPtr(BaseMsg); 21 | *message = BCON_NEW( 22 | "data", BCON_INT32(Int64Message->_Data) 23 | ); 24 | return true; 25 | } 26 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/std_msgs/StdMsgsMultiArrayLayoutConverter.cpp: -------------------------------------------------------------------------------- 1 | #include "StdMsgsMultiArrayLayoutConverter.h" 2 | 3 | 4 | UStdMsgsMultiArrayLayoutConverter::UStdMsgsMultiArrayLayoutConverter() 5 | { 6 | _MessageType = "std_msgs/MultiArrayLayout"; 7 | } 8 | 9 | bool UStdMsgsMultiArrayLayoutConverter::ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr &BaseMsg) 10 | { 11 | auto msg = new ROSMessages::std_msgs::MultiArrayLayout; 12 | BaseMsg = TSharedPtr(msg); 13 | return _bson_extract_child_multi_array_layout(message->full_msg_bson_, "msg", msg); 14 | } 15 | 16 | bool UStdMsgsMultiArrayLayoutConverter::ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message) 17 | { 18 | auto CastMsg = StaticCastSharedPtr(BaseMsg); 19 | *message = bson_new(); 20 | _bson_append_multi_array_layout(*message, CastMsg.Get()); 21 | return true; 22 | } -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/geometry_msgs/GeometryMsgsPointConverter.cpp: -------------------------------------------------------------------------------- 1 | #include "Conversion/Messages/geometry_msgs/GeometryMsgsPointConverter.h" 2 | 3 | #include "geometry_msgs/Point.h" 4 | 5 | UGeometryMsgsPointConverter::UGeometryMsgsPointConverter() 6 | { 7 | _MessageType = "geometry_msgs/Point"; 8 | } 9 | 10 | bool UGeometryMsgsPointConverter::ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr &BaseMsg) 11 | { 12 | auto msg = new ROSMessages::geometry_msgs::Point(); 13 | BaseMsg = TSharedPtr(msg); 14 | return _bson_extract_child_point(message->full_msg_bson_, "msg", msg); 15 | } 16 | 17 | bool UGeometryMsgsPointConverter::ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message) 18 | { 19 | auto CastMSG = StaticCastSharedPtr(BaseMsg); 20 | *message = bson_new(); 21 | _bson_append_point(*message, CastMSG.Get()); 22 | return true; 23 | } 24 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/sensor_msgs/SensorMsgsJointStateConverter.cpp: -------------------------------------------------------------------------------- 1 | #include "Conversion/Messages/sensor_msgs/SensorMsgsJointStateConverter.h" 2 | 3 | 4 | USensorMsgsJointStateConverter::USensorMsgsJointStateConverter() 5 | { 6 | _MessageType = "sensor_msgs/JointState"; 7 | } 8 | 9 | bool USensorMsgsJointStateConverter::ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr& BaseMsg) 10 | { 11 | 12 | auto msg = new ROSMessages::sensor_msgs::JointState(); 13 | BaseMsg = TSharedPtr(msg); 14 | return _bson_extract_child_joint_state(message->full_msg_bson_, "msg", msg); 15 | } 16 | 17 | bool USensorMsgsJointStateConverter::ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message) 18 | { 19 | auto CastMsg = StaticCastSharedPtr(BaseMsg); 20 | *message = bson_new(); 21 | _bson_append_joint_state(*message, CastMsg.Get()); 22 | return true; 23 | } -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/geometry_msgs/GeometryMsgsQuaternionConverter.cpp: -------------------------------------------------------------------------------- 1 | #include "Conversion/Messages/geometry_msgs/GeometryMsgsQuaternionConverter.h" 2 | 3 | 4 | UGeometryMsgsQuaternionConverter::UGeometryMsgsQuaternionConverter() 5 | { 6 | _MessageType = "geometry_msgs/Quaternion"; 7 | } 8 | 9 | bool UGeometryMsgsQuaternionConverter::ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr &BaseMsg) 10 | { 11 | auto msg = new ROSMessages::geometry_msgs::Quaternion(); 12 | BaseMsg = TSharedPtr(msg); 13 | return _bson_extract_child_quaternion(message->full_msg_bson_, "msg", msg); 14 | } 15 | 16 | bool UGeometryMsgsQuaternionConverter::ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message) 17 | { 18 | auto CastMsg = StaticCastSharedPtr(BaseMsg); 19 | *message = bson_new(); 20 | _bson_append_quaternion(*message, CastMsg.Get()); 21 | return true; 22 | } -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/std_msgs/StdMsgsUInt8MultiArrayConverter.cpp: -------------------------------------------------------------------------------- 1 | #include "Conversion/Messages/std_msgs/StdMsgsUInt8MultiArrayConverter.h" 2 | 3 | UStdMsgsUInt8MultiArrayConverter::UStdMsgsUInt8MultiArrayConverter() 4 | { 5 | _MessageType = "std_msgs/UInt8MultiArray"; 6 | } 7 | 8 | bool UStdMsgsUInt8MultiArrayConverter::ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr &BaseMsg) 9 | { 10 | auto msg = new ROSMessages::std_msgs::UInt8MultiArray; 11 | BaseMsg = TSharedPtr(msg); 12 | return _bson_extract_child_uint8_multi_array(message->full_msg_bson_, "msg", msg); 13 | } 14 | 15 | bool UStdMsgsUInt8MultiArrayConverter::ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message) 16 | { 17 | auto CastMsg = StaticCastSharedPtr(BaseMsg); 18 | *message = bson_new(); 19 | _bson_append_uint8_multi_array(*message, CastMsg.Get()); 20 | return true; 21 | } -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/sensor_msgs/SensorMsgsNavSatStatusConverter.cpp: -------------------------------------------------------------------------------- 1 | #include "Conversion/Messages/sensor_msgs/SensorMsgsNavSatStatusConverter.h" 2 | 3 | 4 | USensorMsgsNavSatStatusConverter::USensorMsgsNavSatStatusConverter() 5 | { 6 | _MessageType = "sensor_msgs/NavSatStatus"; 7 | } 8 | 9 | bool USensorMsgsNavSatStatusConverter::ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr &BaseMsg) 10 | { 11 | auto msg = new ROSMessages::sensor_msgs::NavSatStatus(); 12 | BaseMsg = TSharedPtr(msg); 13 | return _bson_extract_child_nav_sat_status(message->full_msg_bson_, "msg", msg); 14 | } 15 | 16 | bool USensorMsgsNavSatStatusConverter::ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message) 17 | { 18 | auto CastMsg = StaticCastSharedPtr(BaseMsg); 19 | *message = bson_new(); 20 | _bson_append_nav_sat_status(*message, CastMsg.Get()); 21 | return true; 22 | } -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/sensor_msgs/SensorMsgsPointCloud2Converter.cpp: -------------------------------------------------------------------------------- 1 | #include "Conversion/Messages/sensor_msgs/SensorMsgsPointCloud2Converter.h" 2 | 3 | 4 | USensorMsgsPointCloud2Converter::USensorMsgsPointCloud2Converter() 5 | { 6 | _MessageType = "sensor_msgs/PointCloud2"; 7 | } 8 | 9 | bool USensorMsgsPointCloud2Converter::ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr &BaseMsg) 10 | { 11 | auto msg = new ROSMessages::sensor_msgs::PointCloud2; 12 | BaseMsg = TSharedPtr(msg); 13 | return _bson_extract_child_point_cloud2(message->full_msg_bson_, "msg", msg); 14 | } 15 | 16 | bool USensorMsgsPointCloud2Converter::ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message) 17 | { 18 | auto CastMsg = StaticCastSharedPtr(BaseMsg); 19 | *message = bson_new(); 20 | _bson_append_point_cloud2(*message, CastMsg.Get()); 21 | return true; 22 | } -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/std_msgs/StdMsgsFloat32Converter.cpp: -------------------------------------------------------------------------------- 1 | #include "Conversion/Messages/std_msgs/StdMsgsFloat32Converter.h" 2 | 3 | 4 | UStdMsgsFloat32Converter::UStdMsgsFloat32Converter() 5 | { 6 | _MessageType = "std_msgs/Float32"; 7 | } 8 | 9 | bool UStdMsgsFloat32Converter::ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr &BaseMsg) { 10 | bool KeyFound = false; 11 | 12 | float Data = (float)GetDoubleFromBSON(TEXT("msg.data"), message->full_msg_bson_, KeyFound); 13 | if (!KeyFound) return false; 14 | 15 | BaseMsg = TSharedPtr(new ROSMessages::std_msgs::Float32(Data)); 16 | return true; 17 | } 18 | 19 | bool UStdMsgsFloat32Converter::ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message) { 20 | auto Float32Message = StaticCastSharedPtr(BaseMsg); 21 | *message = BCON_NEW( 22 | "data", BCON_DOUBLE(Float32Message->_Data) 23 | ); 24 | return true; 25 | } -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/std_msgs/StdMsgsStringConverter.cpp: -------------------------------------------------------------------------------- 1 | #include "Conversion/Messages/std_msgs/StdMsgsStringConverter.h" 2 | 3 | 4 | UStdMsgsStringConverter::UStdMsgsStringConverter() 5 | { 6 | _MessageType = "std_msgs/String"; 7 | } 8 | 9 | bool UStdMsgsStringConverter::ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr &BaseMsg) 10 | { 11 | bool KeyFound = false; 12 | 13 | FString Data = GetFStringFromBSON(TEXT("msg.data"), message->full_msg_bson_, KeyFound); 14 | if (!KeyFound) return false; 15 | 16 | BaseMsg = TSharedPtr(new ROSMessages::std_msgs::String(Data)); 17 | return true; 18 | } 19 | 20 | bool UStdMsgsStringConverter::ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message) 21 | { 22 | auto StringMessage = StaticCastSharedPtr(BaseMsg); 23 | *message = BCON_NEW( 24 | "data", TCHAR_TO_UTF8(*StringMessage->_Data) 25 | ); 26 | return true; 27 | } -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/geometry_msgs/GeometryMsgsPoseStampedConverter.cpp: -------------------------------------------------------------------------------- 1 | #include "Conversion/Messages/geometry_msgs/GeometryMsgsPoseStampedConverter.h" 2 | 3 | 4 | UGeometryMsgsPoseStampedConverter::UGeometryMsgsPoseStampedConverter() 5 | { 6 | _MessageType = "geometry_msgs/PoseStamped"; 7 | } 8 | 9 | bool UGeometryMsgsPoseStampedConverter::ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr &BaseMsg) 10 | { 11 | auto msg = new ROSMessages::geometry_msgs::PoseStamped(); 12 | BaseMsg = TSharedPtr(msg); 13 | return _bson_extract_child_pose_stamped(message->full_msg_bson_, "msg", msg);; 14 | } 15 | 16 | bool UGeometryMsgsPoseStampedConverter::ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message) 17 | { 18 | auto CastMsg = StaticCastSharedPtr(BaseMsg); 19 | *message = bson_new(); 20 | _bson_append_pose_stamped(*message, CastMsg.Get()); 21 | return true; 22 | } -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/sensor_msgs/SensorMsgsCompressedImageConverter.cpp: -------------------------------------------------------------------------------- 1 | #include "Conversion/Messages/sensor_msgs/SensorMsgsCompressedImageConverter.h" 2 | 3 | 4 | USensorMsgsCompressedImageConverter::USensorMsgsCompressedImageConverter() 5 | { 6 | _MessageType = "sensor_msgs/CompressedImage"; 7 | } 8 | 9 | bool USensorMsgsCompressedImageConverter::ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr &BaseMsg) 10 | { 11 | auto msg = new ROSMessages::sensor_msgs::CompressedImage; 12 | BaseMsg = TSharedPtr(msg); 13 | return _bson_extract_child_image(message->full_msg_bson_, "msg", msg); 14 | } 15 | 16 | bool USensorMsgsCompressedImageConverter::ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message) 17 | { 18 | auto CastMsg = StaticCastSharedPtr(BaseMsg); 19 | *message = bson_new(); 20 | _bson_append_image(*message, CastMsg.Get()); 21 | return true; 22 | } -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/sensor_msgs/SensorMsgsMagneticFieldConverter.cpp: -------------------------------------------------------------------------------- 1 | #include "Conversion/Messages/sensor_msgs/SensorMsgsMagneticFieldConverter.h" 2 | 3 | USensorMsgsMagneticFieldConverter::USensorMsgsMagneticFieldConverter() 4 | { 5 | _MessageType = "sensor_msgs/MagneticField"; 6 | } 7 | 8 | bool USensorMsgsMagneticFieldConverter::ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr& BaseMsg) 9 | { 10 | auto msg = new ROSMessages::sensor_msgs::MagneticField(); 11 | BaseMsg = TSharedPtr(msg); 12 | return _bson_extract_child_magnetic_field(message->full_msg_bson_, "msg", msg); 13 | } 14 | 15 | bool USensorMsgsMagneticFieldConverter::ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message) 16 | { 17 | auto CastMsg = StaticCastSharedPtr(BaseMsg); 18 | *message = bson_new(); 19 | _bson_append_magnetic_field(*message, CastMsg.Get()); 20 | return true; 21 | } 22 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/std_msgs/StdMsgsFloat32MultiArrayConverter.cpp: -------------------------------------------------------------------------------- 1 | #include "Conversion/Messages/std_msgs/StdMsgsFloat32MultiArrayConverter.h" 2 | 3 | UStdMsgsFloat32MultiArrayConverter::UStdMsgsFloat32MultiArrayConverter() 4 | { 5 | _MessageType = "std_msgs/Float32MultiArray"; 6 | } 7 | 8 | bool UStdMsgsFloat32MultiArrayConverter::ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr &BaseMsg) 9 | { 10 | auto msg = new ROSMessages::std_msgs::Float32MultiArray; 11 | BaseMsg = TSharedPtr(msg); 12 | return _bson_extract_child_float_multi_array(message->full_msg_bson_, "msg", msg); 13 | } 14 | 15 | bool UStdMsgsFloat32MultiArrayConverter::ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message) 16 | { 17 | auto CastMsg = StaticCastSharedPtr(BaseMsg); 18 | *message = bson_new(); 19 | _bson_append_float_multi_array(*message, CastMsg.Get()); 20 | return true; 21 | } -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/actionlib_msgs/ActionlibMsgsGoalStatusConverter.cpp: -------------------------------------------------------------------------------- 1 | #include "Conversion/Messages/actionlib_msgs/ActionlibMsgsGoalStatusConverter.h" 2 | 3 | 4 | UActionlibMsgsGoalStatusConverter::UActionlibMsgsGoalStatusConverter() 5 | { 6 | _MessageType = "actionlib_msgs/GoalStatus"; 7 | } 8 | 9 | bool UActionlibMsgsGoalStatusConverter::ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr &BaseMsg) 10 | { 11 | auto msg = new ROSMessages::actionlib_msgs::GoalStatus(); 12 | BaseMsg = TSharedPtr(msg); 13 | return _bson_extract_child_goal_status(message->full_msg_bson_, "msg", msg); 14 | } 15 | 16 | bool UActionlibMsgsGoalStatusConverter::ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message) 17 | { 18 | auto CastMSG = StaticCastSharedPtr(BaseMsg); 19 | *message = bson_new(); 20 | _bson_append_goal_status(*message, CastMSG.Get()); 21 | return true; 22 | } 23 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/geometry_msgs/GeometryMsgsTransformConverter.cpp: -------------------------------------------------------------------------------- 1 | #include "Conversion/Messages/geometry_msgs/GeometryMsgsTransformConverter.h" 2 | 3 | 4 | UGeometryMsgsTransformConverter::UGeometryMsgsTransformConverter() 5 | { 6 | _MessageType = "geometry_msgs/Transform"; 7 | } 8 | 9 | bool UGeometryMsgsTransformConverter::ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr &BaseMsg) 10 | { 11 | auto msg = new ROSMessages::geometry_msgs::Transform; 12 | BaseMsg = TSharedPtr(msg); 13 | return _bson_extract_child_transform(message->full_msg_bson_, "msg", msg); 14 | } 15 | 16 | bool UGeometryMsgsTransformConverter::ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message) 17 | { 18 | auto CastMsg = StaticCastSharedPtr(BaseMsg); 19 | *message = bson_new(); 20 | _bson_append_transform(*message, CastMsg.Get()); 21 | return true; 22 | } -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/sensor_msgs/SensorMsgsRegionOfInterestConverter.cpp: -------------------------------------------------------------------------------- 1 | #include "Conversion/Messages/sensor_msgs/SensorMsgsRegionOfInterestConverter.h" 2 | 3 | 4 | USensorMsgsRegionOfInterestConverter::USensorMsgsRegionOfInterestConverter() 5 | { 6 | _MessageType = "sensor_msgs/RegionOfInterest"; 7 | } 8 | 9 | bool USensorMsgsRegionOfInterestConverter::ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr &BaseMsg) 10 | { 11 | auto msg = new ROSMessages::sensor_msgs::RegionOfInterest(); 12 | BaseMsg = TSharedPtr(msg); 13 | return _bson_extract_child_roi(message->full_msg_bson_, "msg", msg); 14 | } 15 | 16 | bool USensorMsgsRegionOfInterestConverter::ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message) 17 | { 18 | auto CastMsg = StaticCastSharedPtr(BaseMsg); 19 | *message = bson_new(); 20 | _bson_append_roi(*message, CastMsg.Get()); 21 | return true; 22 | } -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/geometry_msgs/GeometryMsgsTwistStampedConverter.cpp: -------------------------------------------------------------------------------- 1 | #include "Conversion/Messages/geometry_msgs/GeometryMsgsTwistStampedConverter.h" 2 | 3 | 4 | UGeometryMsgsTwistStampedConverter::UGeometryMsgsTwistStampedConverter() 5 | { 6 | _MessageType = "geometry_msgs/TwistStamped"; 7 | } 8 | 9 | bool UGeometryMsgsTwistStampedConverter::ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr &BaseMsg) 10 | { 11 | auto msg = new ROSMessages::geometry_msgs::TwistStamped(); 12 | BaseMsg = TSharedPtr(msg); 13 | return _bson_extract_child_twist_stamped(message->full_msg_bson_, "msg", msg); 14 | } 15 | 16 | bool UGeometryMsgsTwistStampedConverter::ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message) 17 | { 18 | auto CastMsg = StaticCastSharedPtr(BaseMsg); 19 | *message = bson_new(); 20 | _bson_append_twist_stamped(*message, CastMsg.Get()); 21 | return true; 22 | } -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/std_msgs/StdMsgsMultiArrayDimensionConverter.cpp: -------------------------------------------------------------------------------- 1 | #include "Conversion/Messages/std_msgs/StdMsgsMultiArrayDimensionConverter.h" 2 | 3 | UStdMsgsMultiArrayDimensionConverter::UStdMsgsMultiArrayDimensionConverter() 4 | { 5 | _MessageType = "std_msgs/MultiArrayDimension"; 6 | } 7 | 8 | bool UStdMsgsMultiArrayDimensionConverter::ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr &BaseMsg) 9 | { 10 | auto msg = new ROSMessages::std_msgs::MultiArrayDimension; 11 | BaseMsg = TSharedPtr(msg); 12 | return _bson_extract_child_multi_array_dimension(message->full_msg_bson_, "msg", msg); 13 | } 14 | 15 | bool UStdMsgsMultiArrayDimensionConverter::ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message) 16 | { 17 | auto CastMsg = StaticCastSharedPtr(BaseMsg); 18 | *message = bson_new(); 19 | _bson_append_multi_array_dimension(*message, CastMsg.Get()); 20 | return true; 21 | } -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/rosbridge2cpp/ros_tf_broadcaster.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "rapidjson/document.h" 4 | #include 5 | 6 | #include "ros_bridge.h" 7 | #include "ros_topic.h" 8 | #include "helper.h" 9 | 10 | using json = rapidjson::Document; 11 | 12 | namespace rosbridge2cpp { 13 | class ROSTFBroadcaster { 14 | public: 15 | ROSTFBroadcaster(ROSBridge &ros) : ros_(ros) {}; 16 | 17 | // Send a single transform to /tf in JSON mode 18 | void SendTransform(json &geometry_msgs_transformstamped_msg); 19 | // Send Transform in BSON mode 20 | void SendTransform(bson_t &bson); 21 | 22 | // Accepts an json document (where .IsArray() is true) that contains 23 | // an array of geometry_msgs_transformstamped messages. 24 | // Only to be used in json mode 25 | void SendTransforms(json &geometry_msgs_transformstamped_array_msg); 26 | 27 | ~ROSTFBroadcaster() = default; 28 | 29 | private: 30 | ROSBridge &ros_; 31 | ROSTopic tf_topic_{ ros_,"/tf","tf/tfMessage" }; 32 | }; 33 | } 34 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/geometry_msgs/GeometryMsgsPoseWithCovarianceConverter.cpp: -------------------------------------------------------------------------------- 1 | #include "GeometryMsgsPoseWithCovarianceConverter.h" 2 | 3 | 4 | UGeometryMsgsPoseWithCovarianceConverter::UGeometryMsgsPoseWithCovarianceConverter() 5 | { 6 | _MessageType = "geometry_msgs/PoseWithCovariance"; 7 | } 8 | 9 | bool UGeometryMsgsPoseWithCovarianceConverter::ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr &BaseMsg) 10 | { 11 | auto msg = new ROSMessages::geometry_msgs::PoseWithCovariance(); 12 | BaseMsg = TSharedPtr(msg); 13 | return _bson_extract_child_pose_with_covariance(message->full_msg_bson_, "msg", msg); 14 | } 15 | 16 | bool UGeometryMsgsPoseWithCovarianceConverter::ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message) 17 | { 18 | auto CastMsg = StaticCastSharedPtr(BaseMsg); 19 | *message = bson_new(); 20 | _bson_append_pose_with_covariance(*message, CastMsg.Get()); 21 | return true; 22 | } -------------------------------------------------------------------------------- /Source/ROSIntegration/Public/sensor_msgs/CompressedImage.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ROSBaseMsg.h" 4 | #include "std_msgs/Header.h" 5 | 6 | namespace ROSMessages { 7 | namespace sensor_msgs { 8 | class CompressedImage : public FROSBaseMsg { 9 | public: 10 | CompressedImage() { 11 | _MessageType = "sensor_msgs/CompressedImage"; 12 | } 13 | 14 | /** Header timestamp should be acquisition time of image 15 | * Header frame_id should be optical frame of camera 16 | * origin of frame should be optical center of camera 17 | * +x should point to the right in the image 18 | * +y should point down in the image 19 | * +z should point into to plane of the image 20 | */ 21 | ROSMessages::std_msgs::Header header; 22 | 23 | /** Specifies the format of the data 24 | * Acceptable values: jpeg, png 25 | */ 26 | FString format; 27 | 28 | /** Compressed image buffer */ 29 | const uint8* data; 30 | 31 | /** image buffer size */ 32 | int data_size; 33 | }; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/geometry_msgs/GeometryMsgsTwistWithCovarianceConverter.cpp: -------------------------------------------------------------------------------- 1 | #include "GeometryMsgsTwistWithCovarianceConverter.h" 2 | 3 | 4 | UGeometryMsgsTwistWithCovarianceConverter::UGeometryMsgsTwistWithCovarianceConverter() 5 | { 6 | _MessageType = "geometry_msgs/TwistWithCovariance"; 7 | } 8 | 9 | bool UGeometryMsgsTwistWithCovarianceConverter::ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr &BaseMsg) 10 | { 11 | auto msg = new ROSMessages::geometry_msgs::TwistWithCovariance(); 12 | BaseMsg = TSharedPtr(msg); 13 | return _bson_extract_child_twist_with_covariance(message->full_msg_bson_, "msg", msg); 14 | } 15 | 16 | bool UGeometryMsgsTwistWithCovarianceConverter::ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message) 17 | { 18 | auto CastMsg = StaticCastSharedPtr(BaseMsg); 19 | *message = bson_new(); 20 | _bson_append_twist_with_covariance(*message, CastMsg.Get()); 21 | return true; 22 | } -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/std_msgs/StdMsgsBoolConverter.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | 4 | #include "Conversion/Messages/std_msgs/StdMsgsBoolConverter.h" 5 | 6 | 7 | UStdMsgsBoolConverter::UStdMsgsBoolConverter() 8 | { 9 | _MessageType = "std_msgs/Bool"; 10 | } 11 | 12 | bool UStdMsgsBoolConverter::ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr &BaseMsg) { 13 | bool KeyFound = false; 14 | 15 | bool Data = (float)GetBoolFromBSON(TEXT("msg.data"), message->full_msg_bson_, KeyFound); 16 | if (!KeyFound) return false; 17 | 18 | BaseMsg = TSharedPtr(new ROSMessages::std_msgs::Bool(Data)); 19 | return true; 20 | } 21 | 22 | bool UStdMsgsBoolConverter::ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message) { 23 | auto BoolMessage = StaticCastSharedPtr(BaseMsg); 24 | *message = BCON_NEW( 25 | "data", BCON_BOOL(BoolMessage->_Data) 26 | ); 27 | return true; 28 | } -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/rosbridge2cpp/ros_tf_broadcaster.cpp: -------------------------------------------------------------------------------- 1 | #include "ros_tf_broadcaster.h" 2 | 3 | namespace rosbridge2cpp { 4 | void ROSTFBroadcaster::SendTransform(json &geometry_msgs_transformstamped_msg) 5 | { 6 | assert(geometry_msgs_transformstamped_msg.IsObject()); 7 | 8 | rapidjson::Document transform_array; 9 | transform_array.SetArray(); 10 | transform_array.PushBack(geometry_msgs_transformstamped_msg, transform_array.GetAllocator()); 11 | 12 | SendTransforms(transform_array); 13 | } 14 | 15 | void ROSTFBroadcaster::SendTransforms(json &geometry_msgs_transformstamped_array_msg) 16 | { 17 | assert(geometry_msgs_transformstamped_array_msg.IsArray()); 18 | 19 | rapidjson::Document tf_message; 20 | tf_message.SetObject(); 21 | 22 | tf_message.AddMember("transforms", geometry_msgs_transformstamped_array_msg, tf_message.GetAllocator()); 23 | 24 | tf_topic_.Publish(tf_message); 25 | } 26 | 27 | void ROSTFBroadcaster::SendTransform(bson_t &bson) 28 | { 29 | tf_topic_.Publish(&bson); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/actionlib_msgs/ActionlibMsgsGoalStatusArrayConverter.cpp: -------------------------------------------------------------------------------- 1 | #include "Conversion/Messages/actionlib_msgs/ActionlibMsgsGoalStatusArrayConverter.h" 2 | 3 | 4 | UActionlibMsgsGoalStatusArrayConverter::UActionlibMsgsGoalStatusArrayConverter() 5 | { 6 | _MessageType = "actionlib_msgs/GoalStatusArray"; 7 | } 8 | 9 | bool UActionlibMsgsGoalStatusArrayConverter::ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr &BaseMsg) 10 | { 11 | auto msg = new ROSMessages::actionlib_msgs::GoalStatusArray(); 12 | BaseMsg = TSharedPtr(msg); 13 | return _bson_extract_child_goal_status_array(message->full_msg_bson_, "msg", msg); 14 | } 15 | 16 | bool UActionlibMsgsGoalStatusArrayConverter::ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message) 17 | { 18 | auto CastMSG = StaticCastSharedPtr(BaseMsg); 19 | *message = bson_new(); 20 | _bson_append_goal_status_array(*message, CastMSG.Get()); 21 | return true; 22 | } 23 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/geometry_msgs/GeometryMsgsTransformStampedConverter.cpp: -------------------------------------------------------------------------------- 1 | #include "Conversion/Messages/geometry_msgs/GeometryMsgsTransformStampedConverter.h" 2 | 3 | 4 | UGeometryMsgsTransformStampedConverter::UGeometryMsgsTransformStampedConverter() 5 | { 6 | _MessageType = "geometry_msgs/TransformStamped"; 7 | } 8 | 9 | bool UGeometryMsgsTransformStampedConverter::ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr &BaseMsg) 10 | { 11 | auto msg = new ROSMessages::geometry_msgs::TransformStamped; 12 | BaseMsg = TSharedPtr(msg); 13 | return _bson_extract_child_transform_stamped(message->full_msg_bson_, "msg", msg); 14 | } 15 | 16 | bool UGeometryMsgsTransformStampedConverter::ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message) 17 | { 18 | auto CastMsg = StaticCastSharedPtr(BaseMsg); 19 | *message = bson_new(); 20 | _bson_append_transform_stamped(*message, CastMsg.Get()); 21 | return true; 22 | } -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/std_msgs/StdMsgsUInt8Converter.cpp: -------------------------------------------------------------------------------- 1 | #include "Conversion/Messages/std_msgs/StdMsgsUInt8Converter.h" 2 | 3 | 4 | UStdMsgsUInt8Converter::UStdMsgsUInt8Converter() 5 | { 6 | _MessageType = "std_msgs/UInt8"; 7 | } 8 | 9 | bool UStdMsgsUInt8Converter::ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr &BaseMsg) { 10 | bool KeyFound = false; 11 | 12 | int32 DataAsInt32 = GetInt32FromBSON(TEXT("msg.data"), message->full_msg_bson_, KeyFound); 13 | if (!KeyFound) return false; 14 | uint8 Data = static_cast(DataAsInt32); 15 | BaseMsg = TSharedPtr(new ROSMessages::std_msgs::UInt8(Data)); 16 | return true; 17 | } 18 | 19 | bool UStdMsgsUInt8Converter::ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message) { 20 | auto UInt8Message = StaticCastSharedPtr(BaseMsg); 21 | int32 DataAsInt32 = static_cast(UInt8Message->_Data); 22 | *message = BCON_NEW( 23 | "data", BCON_INT32(DataAsInt32) 24 | ); 25 | return true; 26 | } 27 | -------------------------------------------------------------------------------- /ThirdParty/bson/include/mac/bson-value.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | 18 | #ifndef BSON_VALUE_H 19 | #define BSON_VALUE_H 20 | 21 | 22 | #include "bson-macros.h" 23 | #include "bson-types.h" 24 | 25 | 26 | BSON_BEGIN_DECLS 27 | 28 | 29 | BSON_EXPORT (void) 30 | bson_value_copy (const bson_value_t *src, bson_value_t *dst); 31 | BSON_EXPORT (void) 32 | bson_value_destroy (bson_value_t *value); 33 | 34 | 35 | BSON_END_DECLS 36 | 37 | 38 | #endif /* BSON_VALUE_H */ 39 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Classes/SpawnableObject.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include "SpawnableObject.generated.h" 9 | 10 | UCLASS() 11 | class ROSINTEGRATION_API ASpawnableObject : public AActor 12 | { 13 | GENERATED_BODY() 14 | 15 | public: 16 | /// Sets default values for this actor's properties 17 | ASpawnableObject(); 18 | 19 | ASpawnableObject(const FObjectInitializer& ObjectInitializer); 20 | 21 | // A unique id that must be set by the caller 22 | UPROPERTY(VisibleAnywhere, Category="SpawnableObject") 23 | int32 Id; 24 | 25 | UMaterialInstanceDynamic* TheMatInst; 26 | 27 | FLinearColor ColorToAssign; 28 | 29 | FString MeshToAssign, MaterialToAssign; 30 | 31 | bool ActivatePhysics = false; 32 | 33 | 34 | // Called when the game starts or when spawned 35 | virtual void BeginPlay() override; 36 | 37 | // Called every frame 38 | virtual void Tick(float DeltaSeconds) override; 39 | 40 | void SetMaterial(); 41 | void SetStaticMesh(); 42 | }; 43 | -------------------------------------------------------------------------------- /ThirdParty/bson/include/windows/bson-value.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | 18 | #ifndef BSON_VALUE_H 19 | #define BSON_VALUE_H 20 | 21 | 22 | #include "bson-macros.h" 23 | #include "bson-types.h" 24 | 25 | 26 | BSON_BEGIN_DECLS 27 | 28 | 29 | void bson_value_copy (const bson_value_t *src, 30 | bson_value_t *dst); 31 | void bson_value_destroy (bson_value_t *value); 32 | 33 | 34 | BSON_END_DECLS 35 | 36 | 37 | #endif /* BSON_VALUE_H */ 38 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/tf2_msgs/Tf2MsgsTFMessageConverter.cpp: -------------------------------------------------------------------------------- 1 | #include "Conversion/Messages/tf2_msgs/Tf2MsgsTFMessageConverter.h" 2 | 3 | 4 | UTf2MsgsTFMessageConverter::UTf2MsgsTFMessageConverter() 5 | { 6 | _MessageType = "tf2_msgs/TFMessage"; 7 | } 8 | 9 | bool UTf2MsgsTFMessageConverter::ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr &BaseMsg) 10 | { 11 | auto msg = new ROSMessages::tf2_msgs::TFMessage; 12 | BaseMsg = TSharedPtr(msg); 13 | return _bson_extract_child_tf2_msg(message->full_msg_bson_, "msg", msg); 14 | } 15 | 16 | bool UTf2MsgsTFMessageConverter::ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message) 17 | { 18 | auto CastMsg = StaticCastSharedPtr(BaseMsg); 19 | *message = bson_new(); 20 | if (CastMsg->transforms.Num() == 0) 21 | { 22 | UE_LOG(LogTemp, Warning, TEXT("No transform saved in TFMessage. Can't convert message")); 23 | return false; 24 | } 25 | _bson_append_tf2_msg(*message, CastMsg.Get()); 26 | return true; 27 | } -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/sensor_msgs/SensorMsgsCameraInfoConverter.cpp: -------------------------------------------------------------------------------- 1 | #include "Conversion/Messages/sensor_msgs/SensorMsgsCameraInfoConverter.h" 2 | 3 | 4 | USensorMsgsCameraInfoConverter::USensorMsgsCameraInfoConverter() 5 | { 6 | _MessageType = "sensor_msgs/CameraInfo"; 7 | } 8 | 9 | bool USensorMsgsCameraInfoConverter::ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr &BaseMsg) 10 | { 11 | auto msg = new ROSMessages::sensor_msgs::CameraInfo; 12 | BaseMsg = TSharedPtr(msg); 13 | return _bson_extract_child_camera_info(message->full_msg_bson_, "msg", msg); 14 | } 15 | 16 | bool USensorMsgsCameraInfoConverter::ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message) 17 | { 18 | 19 | auto CastMsg = StaticCastSharedPtr(BaseMsg); 20 | 21 | // assert(CastMsg->K.Num() == 9); // TODO: use Unreal assertions 22 | // assert(CastMsg->R.Num() == 9); 23 | // assert(CastMsg->P.Num() == 12); 24 | 25 | *message = bson_new(); 26 | _bson_append_camera_info(*message, CastMsg.Get()); 27 | return true; 28 | } -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Services/std_srvs/StdSrvsTriggerRequestConverter.cpp: -------------------------------------------------------------------------------- 1 | #include "Conversion/Services/std_srvs/StdSrvsTriggerRequestConverter.h" 2 | #include "std_srvs/TriggerRequest.h" 3 | 4 | 5 | UStdSrvsTriggerRequestConverter::UStdSrvsTriggerRequestConverter() 6 | { 7 | _ServiceType = "std_srvs/Trigger"; 8 | } 9 | 10 | bool UStdSrvsTriggerRequestConverter::ConvertOutgoingRequest(TSharedPtr Request, bson_t** BSONRequest) 11 | { 12 | auto TriggerRequest = StaticCastSharedPtr(Request); 13 | *BSONRequest = bson_new(); 14 | 15 | return true; 16 | } 17 | 18 | bool UStdSrvsTriggerRequestConverter::ConvertIncomingRequest(ROSBridgeCallServiceMsg &req, TSharedPtr Request) 19 | { 20 | //*Request = MakeShareable(new std_srvs::FTriggerRequest); 21 | auto ServiceRequest = StaticCastSharedPtr(Request); 22 | 23 | return true; 24 | } 25 | 26 | TSharedPtr UStdSrvsTriggerRequestConverter::AllocateConcreteRequest() 27 | { 28 | return MakeShareable(new std_srvs::FTriggerRequest); 29 | } -------------------------------------------------------------------------------- /ThirdParty/bson/include/mac/bson-keys.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | 18 | #ifndef BSON_KEYS_H 19 | #define BSON_KEYS_H 20 | 21 | 22 | #include "bson-macros.h" 23 | #include "bson-types.h" 24 | 25 | 26 | BSON_BEGIN_DECLS 27 | 28 | 29 | BSON_EXPORT (size_t) 30 | bson_uint32_to_string (uint32_t value, 31 | const char **strptr, 32 | char *str, 33 | size_t size); 34 | 35 | 36 | BSON_END_DECLS 37 | 38 | 39 | #endif /* BSON_KEYS_H */ 40 | -------------------------------------------------------------------------------- /ThirdParty/bson/include/linux/bson-value.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | 18 | #ifndef BSON_VALUE_H 19 | #define BSON_VALUE_H 20 | 21 | 22 | #include "bson-macros.h" 23 | #include "bson-types.h" 24 | 25 | 26 | BSON_BEGIN_DECLS 27 | 28 | 29 | BSON_API 30 | void bson_value_copy (const bson_value_t *src, 31 | bson_value_t *dst); 32 | BSON_API 33 | void bson_value_destroy (bson_value_t *value); 34 | 35 | 36 | BSON_END_DECLS 37 | 38 | 39 | #endif /* BSON_VALUE_H */ 40 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Services/BaseResponseConverter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "CoreMinimal.h" 4 | #include "rosbridge2cpp/messages/rosbridge_service_response_msg.h" 5 | #include "ROSBaseServiceResponse.h" 6 | #include "Conversion/Messages/BaseMessageConverter.h" 7 | #include "BaseResponseConverter.generated.h" 8 | 9 | 10 | UCLASS() 11 | class ROSINTEGRATION_API UBaseResponseConverter: public UBaseMessageConverter 12 | { 13 | GENERATED_BODY() 14 | 15 | public: 16 | UBaseResponseConverter(); 17 | 18 | UPROPERTY() 19 | FString _ServiceType; 20 | 21 | /// This method will be used to convert the Response an external service to the UnrealRI format 22 | virtual bool ConvertIncomingResponse(const ROSBridgeServiceResponseMsg &res, TSharedRef> Response); 23 | 24 | /// This method will be used to convert the Response from an self-advertised service to the rosbrige2cpp format 25 | virtual bool ConvertOutgoingResponse(TSharedPtr Response, ROSBridgeServiceResponseMsg &res); 26 | 27 | virtual TSharedPtr AllocateConcreteResponse(); 28 | }; -------------------------------------------------------------------------------- /ThirdParty/bson/include/windows/bson-keys.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | 18 | #ifndef BSON_KEYS_H 19 | #define BSON_KEYS_H 20 | 21 | 22 | #include "bson-macros.h" 23 | #include "bson-types.h" 24 | 25 | 26 | BSON_BEGIN_DECLS 27 | 28 | 29 | size_t bson_uint32_to_string (uint32_t value, 30 | const char **strptr, 31 | char *str, 32 | size_t size); 33 | 34 | 35 | BSON_END_DECLS 36 | 37 | 38 | #endif /* BSON_KEYS_H */ 39 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Public/ROSIntegration.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | class FROSIntegrationModule : public IModuleInterface 7 | { 8 | public: 9 | 10 | /** IModuleInterface implementation */ 11 | virtual void StartupModule() override; 12 | virtual void ShutdownModule() override; 13 | 14 | /** 15 | * Singleton-like access to this module's interface. This is just for convenience! 16 | * Beware of calling this during the shutdown phase, though. Your module might have been unloaded already. 17 | * 18 | * @return Returns singleton instance, loading the module on demand if needed 19 | */ 20 | static inline FROSIntegrationModule& Get() 21 | { 22 | return FModuleManager::LoadModuleChecked< FROSIntegrationModule >("ROSIntegration"); 23 | } 24 | 25 | /** 26 | * Checks to see if this module is loaded and ready. It is only valid to call Get() if IsAvailable() returns true. 27 | * 28 | * @return True if the module is loaded and ready to use 29 | */ 30 | static inline bool IsAvailable() 31 | { 32 | return FModuleManager::Get().IsModuleLoaded("ROSIntegration"); 33 | } 34 | }; 35 | -------------------------------------------------------------------------------- /ThirdParty/bson/include/linux/bson-keys.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | 18 | #ifndef BSON_KEYS_H 19 | #define BSON_KEYS_H 20 | 21 | 22 | #include "bson-macros.h" 23 | #include "bson-types.h" 24 | 25 | 26 | BSON_BEGIN_DECLS 27 | 28 | 29 | BSON_API 30 | size_t bson_uint32_to_string (uint32_t value, 31 | const char **strptr, 32 | char *str, 33 | size_t size); 34 | 35 | 36 | BSON_END_DECLS 37 | 38 | 39 | #endif /* BSON_KEYS_H */ 40 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Institute for Artificial Intelligence - University of Bremen 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /ThirdParty/bson/include/windows/bson-clock.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | 18 | #ifndef BSON_CLOCK_H 19 | #define BSON_CLOCK_H 20 | 21 | 22 | #if !defined (BSON_INSIDE) && !defined (BSON_COMPILATION) 23 | # error "Only can be included directly." 24 | #endif 25 | 26 | 27 | #include "bson-compat.h" 28 | #include "bson-macros.h" 29 | #include "bson-types.h" 30 | 31 | 32 | BSON_BEGIN_DECLS 33 | 34 | 35 | int64_t bson_get_monotonic_time (void); 36 | int bson_gettimeofday (struct timeval *tv); 37 | 38 | 39 | BSON_END_DECLS 40 | 41 | 42 | #endif /* BSON_CLOCK_H */ 43 | -------------------------------------------------------------------------------- /ThirdParty/bson/include/mac/bson-clock.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | 18 | #ifndef BSON_CLOCK_H 19 | #define BSON_CLOCK_H 20 | 21 | 22 | #if !defined(BSON_INSIDE) && !defined(BSON_COMPILATION) 23 | #error "Only can be included directly." 24 | #endif 25 | 26 | 27 | #include "bson-compat.h" 28 | #include "bson-macros.h" 29 | #include "bson-types.h" 30 | 31 | 32 | BSON_BEGIN_DECLS 33 | 34 | 35 | BSON_EXPORT (int64_t) 36 | bson_get_monotonic_time (void); 37 | BSON_EXPORT (int) 38 | bson_gettimeofday (struct timeval *tv); 39 | 40 | 41 | BSON_END_DECLS 42 | 43 | 44 | #endif /* BSON_CLOCK_H */ 45 | -------------------------------------------------------------------------------- /ThirdParty/bson/include/linux/bson-clock.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | 18 | #ifndef BSON_CLOCK_H 19 | #define BSON_CLOCK_H 20 | 21 | 22 | #if !defined (BSON_INSIDE) && !defined (BSON_COMPILATION) 23 | # error "Only can be included directly." 24 | #endif 25 | 26 | 27 | #include "bson-compat.h" 28 | #include "bson-macros.h" 29 | #include "bson-types.h" 30 | 31 | 32 | BSON_BEGIN_DECLS 33 | 34 | 35 | BSON_API 36 | int64_t bson_get_monotonic_time (void); 37 | BSON_API 38 | int bson_gettimeofday (struct timeval *tv); 39 | 40 | 41 | BSON_END_DECLS 42 | 43 | 44 | #endif /* BSON_CLOCK_H */ 45 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Public/grid_map_msgs/GridMap.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ROSBaseMsg.h" 4 | 5 | #include "std_msgs/Float32MultiArray.h" 6 | #include "grid_map_msgs/GridMapInfo.h" 7 | #include "geometry_msgs/Pose.h" 8 | 9 | namespace ROSMessages { 10 | namespace grid_map_msgs { 11 | class GridMap : public FROSBaseMsg { 12 | public: 13 | GridMap() { 14 | _MessageType = "grid_map_msgs/GridMap"; 15 | } 16 | 17 | //# Grid map header 18 | //GridMapInfo info 19 | GridMapInfo info; 20 | 21 | //# Grid map layer names. 22 | //string[] layers 23 | TArray layers; 24 | 25 | //# Grid map basic layer names(optional).The basic layers 26 | //# determine which layers from `layers` need to be valid 27 | //# in order for a cell of the grid map to be valid. 28 | //string[] basic_layers 29 | TArray basic_layers; 30 | 31 | //# Grid map data. 32 | //std_msgs / Float32MultiArray[] data 33 | TArray data; 34 | 35 | //# Row start index(default 0). 36 | //uint16 outer_start_index 37 | uint16 outer_start_index; 38 | 39 | //# Column start index(default 0). 40 | //uint16 inner_start_index 41 | uint16 inner_start_index; 42 | }; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Public/nav_msgs/MapMetaData.h: -------------------------------------------------------------------------------- 1 | // 2 | // MapMetaData.h 3 | // HFS 4 | // 5 | // Created by Timothy Saucer on 2/19/19. 6 | // Copyright © 2019 Epic Games, Inc. All rights reserved. 7 | // 8 | 9 | #pragma once 10 | 11 | #include "ROSBaseMsg.h" 12 | #include "geometry_msgs/Pose.h" 13 | 14 | namespace ROSMessages { 15 | namespace nav_msgs { 16 | class MapMetaData : public FROSBaseMsg { 17 | public: 18 | MapMetaData() { 19 | _MessageType = "nav_msgs/MapMetaData"; 20 | } 21 | 22 | MapMetaData(FROSTime map_load_time, float resolution, uint32 width, uint32 height, geometry_msgs::Pose origin) : map_load_time(map_load_time), resolution(resolution), width(width), height(height), origin(origin) 23 | { 24 | _MessageType = "nav_msgs/MapMetaData"; 25 | } 26 | 27 | // time map_load_time 28 | FROSTime map_load_time; 29 | 30 | //float32 resolution 31 | float resolution; 32 | 33 | //uint32 width 34 | uint32 width; 35 | 36 | //uint32 height 37 | uint32 height; 38 | 39 | //geometry_msgs/Pose origin 40 | geometry_msgs::Pose origin; 41 | }; 42 | } 43 | } 44 | 45 | 46 | //time map_load_time 47 | //float32 resolution 48 | //uint32 width 49 | //uint32 height 50 | //geometry_msgs/Pose origin 51 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Public/sensor_msgs/NavSatStatus.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ROSBaseMsg.h" 4 | 5 | // http://docs.ros.org/api/sensor_msgs/html/msg/NavSatStatus.html 6 | namespace ROSMessages { 7 | namespace sensor_msgs { 8 | class NavSatStatus : public FROSBaseMsg { 9 | public: 10 | NavSatStatus() { 11 | _MessageType = "sensor_msgs/NavSatStatus"; 12 | } 13 | 14 | // Status Constants 15 | enum Status : int8 { 16 | STATUS_NO_FIX = -1, // Unable to fix position. 17 | STATUS_FIX = 0, // Unaugmented fix. 18 | STATUS_SBAS_FIX = 1, // With satellite-based augmentation. 19 | STATUS_GBAS_FIX = 2 // With ground-based augmentation. 20 | }; 21 | 22 | // Whether to output an augmented fix is determined by both the fix type and the last time differential 23 | // corrections were received. A fix is valid when status >= STATUS_FIX. 24 | Status status; 25 | 26 | // Service Constants 27 | enum Service : uint16 { 28 | SERVICE_GPS = 1, 29 | SERVICE_GLONASS = 2, 30 | SERVICE_COMPASS = 4, // Includes BeiDou 31 | SERVICE_GALILEO = 8 32 | }; 33 | 34 | // Bits defining which Global Navigation Satellite System signals were used by the receiver. 35 | Service service; 36 | }; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /ThirdParty/bson/include/windows/bson-context.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | 18 | #ifndef BSON_CONTEXT_H 19 | #define BSON_CONTEXT_H 20 | 21 | 22 | #if !defined (BSON_INSIDE) && !defined (BSON_COMPILATION) 23 | # error "Only can be included directly." 24 | #endif 25 | 26 | 27 | #include "bson-macros.h" 28 | #include "bson-types.h" 29 | 30 | 31 | BSON_BEGIN_DECLS 32 | 33 | 34 | bson_context_t *bson_context_new (bson_context_flags_t flags); 35 | void bson_context_destroy (bson_context_t *context); 36 | bson_context_t *bson_context_get_default (void) BSON_GNUC_CONST; 37 | 38 | 39 | BSON_END_DECLS 40 | 41 | 42 | #endif /* BSON_CONTEXT_H */ 43 | -------------------------------------------------------------------------------- /ThirdParty/bson/include/mac/bson-context.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | 18 | #ifndef BSON_CONTEXT_H 19 | #define BSON_CONTEXT_H 20 | 21 | 22 | #if !defined(BSON_INSIDE) && !defined(BSON_COMPILATION) 23 | #error "Only can be included directly." 24 | #endif 25 | 26 | 27 | #include "bson-macros.h" 28 | #include "bson-types.h" 29 | 30 | 31 | BSON_BEGIN_DECLS 32 | 33 | 34 | BSON_EXPORT (bson_context_t *) 35 | bson_context_new (bson_context_flags_t flags); 36 | BSON_EXPORT (void) 37 | bson_context_destroy (bson_context_t *context); 38 | BSON_EXPORT (bson_context_t *) 39 | bson_context_get_default (void) BSON_GNUC_CONST; 40 | 41 | 42 | BSON_END_DECLS 43 | 44 | 45 | #endif /* BSON_CONTEXT_H */ 46 | -------------------------------------------------------------------------------- /ThirdParty/bson/include/windows/bson-version-functions.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | 18 | #if !defined (BSON_INSIDE) && !defined (BSON_COMPILATION) 19 | #error "Only can be included directly." 20 | #endif 21 | 22 | 23 | #ifndef BSON_VERSION_FUNCTIONS_H 24 | #define BSON_VERSION_FUNCTIONS_H 25 | 26 | #include "bson-types.h" 27 | 28 | int bson_get_major_version (void); 29 | int bson_get_minor_version (void); 30 | int bson_get_micro_version (void); 31 | const char *bson_get_version (void); 32 | bool bson_check_version (int required_major, 33 | int required_minor, 34 | int required_micro); 35 | 36 | 37 | #endif /* BSON_VERSION_FUNCTIONS_H */ 38 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Classes/SpawnManager.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | #include "SpawnableObject.h" 7 | #include "SpawnObjectMessage.h" 8 | #include 9 | 10 | #include "SpawnManager.generated.h" 11 | 12 | /** 13 | * Separate Spawning Class since received ROSBridge Messages will 14 | * not have access to the GameThread directly. 15 | * However, this is necessary in order to use SpawnActor 16 | */ 17 | UCLASS() 18 | class ROSINTEGRATION_API USpawnManager : public UObject, public FTickableGameObject 19 | { 20 | GENERATED_BODY() 21 | public: 22 | USpawnManager(); 23 | ~USpawnManager(); 24 | 25 | void Tick(float DeltaTime) override; 26 | bool IsTickable() const override; 27 | bool IsTickableInEditor() const override; 28 | bool IsTickableWhenPaused() const override; 29 | TStatId GetStatId() const override; 30 | 31 | UWorld* GetWorld() const override; 32 | 33 | bool _TickingActive = false; 34 | 35 | bool _TestSpawn = false; 36 | 37 | UWorld* _World; 38 | 39 | 40 | // Warning: 41 | // Enqueued Elements will be deleted after the object has been spawned! 42 | //TQueue _SpawnObjectMessageQueue; // Produces Segfaults :( 43 | //UPROPERTY() 44 | TQueue _SpawnObjectMessageQueue; 45 | }; 46 | -------------------------------------------------------------------------------- /ThirdParty/bson/include/linux/bson-context.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | 18 | #ifndef BSON_CONTEXT_H 19 | #define BSON_CONTEXT_H 20 | 21 | 22 | #if !defined (BSON_INSIDE) && !defined (BSON_COMPILATION) 23 | # error "Only can be included directly." 24 | #endif 25 | 26 | 27 | #include "bson-macros.h" 28 | #include "bson-types.h" 29 | 30 | 31 | BSON_BEGIN_DECLS 32 | 33 | 34 | BSON_API 35 | bson_context_t *bson_context_new (bson_context_flags_t flags); 36 | BSON_API 37 | void bson_context_destroy (bson_context_t *context); 38 | BSON_API 39 | bson_context_t *bson_context_get_default (void) BSON_GNUC_CONST; 40 | 41 | 42 | BSON_END_DECLS 43 | 44 | 45 | #endif /* BSON_CONTEXT_H */ 46 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Visual Studio 2015 user specific files 2 | .vs/ 3 | 4 | # Visual Studio 2015 database file 5 | *.VC.db 6 | 7 | # Compiled Object files 8 | *.slo 9 | *.lo 10 | *.o 11 | *.obj 12 | 13 | # Precompiled Headers 14 | *.gch 15 | *.pch 16 | 17 | # Compiled Dynamic libraries 18 | *.so 19 | *.dylib 20 | *.dll 21 | 22 | # Fortran module files 23 | *.mod 24 | 25 | # Compiled Static libraries 26 | *.lai 27 | *.la 28 | *.a 29 | *.lib 30 | 31 | # Executables 32 | *.exe 33 | *.out 34 | *.app 35 | *.ipa 36 | 37 | # These project files can be generated by the engine 38 | *.xcodeproj 39 | *.xcworkspace 40 | *.sln 41 | *.suo 42 | *.opensdf 43 | *.sdf 44 | *.VC.db 45 | *.VC.opendb 46 | 47 | # Precompiled Assets 48 | SourceArt/**/*.png 49 | SourceArt/**/*.tga 50 | 51 | # Binary Files 52 | Binaries/* 53 | Plugins/*/Binaries/* 54 | 55 | # Builds 56 | Build/* 57 | 58 | # Whitelist PakBlacklist-.txt files 59 | !Build/*/ 60 | Build/*/** 61 | !Build/*/PakBlacklist*.txt 62 | 63 | # Don't ignore icon files in Build 64 | !Build/**/*.ico 65 | 66 | # Built data for maps 67 | *_BuiltData.uasset 68 | 69 | # Configuration files generated by the Editor 70 | Saved/* 71 | 72 | # Compiled source files for the engine to use 73 | Intermediate/* 74 | Plugins/*/Intermediate/* 75 | 76 | # Cache files for the editor to use 77 | DerivedDataCache/* 78 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/rosbridge2cpp/messages/rosbridge_unsubscribe_msg.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include "messages/rosbridge_msg.h" 6 | 7 | class ROSBridgeUnsubscribeMsg : public ROSBridgeMsg { 8 | public: 9 | ROSBridgeUnsubscribeMsg() : ROSBridgeMsg() {} 10 | 11 | ROSBridgeUnsubscribeMsg(bool init_opcode) : ROSBridgeMsg() 12 | { 13 | if (init_opcode) 14 | op_ = ROSBridgeMsg::UNSUBSCRIBE; 15 | } 16 | 17 | virtual ~ROSBridgeUnsubscribeMsg() = default; 18 | 19 | 20 | // Unsubscribe messages will never be received from the client 21 | // So we don't need to fill this instance from JSON or other wire-level representations 22 | bool FromJSON(const rapidjson::Document &data) = delete; 23 | bool FromBSON(bson_t &bson) = delete; 24 | 25 | rapidjson::Document ToJSON(rapidjson::Document::AllocatorType& alloc) 26 | { 27 | rapidjson::Document d(rapidjson::kObjectType); 28 | d.AddMember("op", getOpCodeString(), alloc); 29 | add_if_value_changed(d, alloc, "id", id_); 30 | add_if_value_changed(d, alloc, "topic", topic_); 31 | return d; 32 | } 33 | 34 | void ToBSON(bson_t &bson) 35 | { 36 | BSON_APPEND_UTF8(&bson, "op", getOpCodeString().c_str()); 37 | add_if_value_changed(bson, "id", id_); 38 | 39 | add_if_value_changed(bson, "topic", topic_); 40 | } 41 | 42 | std::string topic_; 43 | private: 44 | /* data */ 45 | }; 46 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/rosbridge2cpp/messages/rosbridge_unadvertise_msg.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include "messages/rosbridge_msg.h" 6 | 7 | class ROSBridgeUnadvertiseMsg : public ROSBridgeMsg { 8 | public: 9 | ROSBridgeUnadvertiseMsg() : ROSBridgeMsg() {} 10 | 11 | ROSBridgeUnadvertiseMsg(bool init_opcode) : ROSBridgeMsg() 12 | { 13 | if (init_opcode) 14 | op_ = ROSBridgeMsg::UNADVERTISE; 15 | } 16 | 17 | virtual ~ROSBridgeUnadvertiseMsg() = default; 18 | 19 | 20 | // Unadvertise messages will never be received from the client 21 | // So we don't need to fill this instance from JSON or other wire-level representations 22 | bool FromJSON(const rapidjson::Document &data) = delete; 23 | bool FromBSON(bson_t &bson) = delete; 24 | 25 | rapidjson::Document ToJSON(rapidjson::Document::AllocatorType& alloc) 26 | { 27 | rapidjson::Document d(rapidjson::kObjectType); 28 | d.AddMember("op", getOpCodeString(), alloc); 29 | add_if_value_changed(d, alloc, "id", id_); 30 | add_if_value_changed(d, alloc, "topic", topic_); 31 | return d; 32 | } 33 | 34 | void ToBSON(bson_t &bson) 35 | { 36 | BSON_APPEND_UTF8(&bson, "op", getOpCodeString().c_str()); 37 | add_if_value_changed(bson, "id", id_); 38 | 39 | add_if_value_changed(bson, "topic", topic_); 40 | } 41 | 42 | 43 | std::string topic_; 44 | private: 45 | /* data */ 46 | }; 47 | -------------------------------------------------------------------------------- /ThirdParty/bson/include/mac/bson-error.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | 18 | #ifndef BSON_ERROR_H 19 | #define BSON_ERROR_H 20 | 21 | 22 | #include "bson-compat.h" 23 | #include "bson-macros.h" 24 | #include "bson-types.h" 25 | 26 | 27 | BSON_BEGIN_DECLS 28 | 29 | 30 | #define BSON_ERROR_JSON 1 31 | #define BSON_ERROR_READER 2 32 | #define BSON_ERROR_INVALID 3 33 | 34 | 35 | BSON_EXPORT (void) 36 | bson_set_error (bson_error_t *error, 37 | uint32_t domain, 38 | uint32_t code, 39 | const char *format, 40 | ...) BSON_GNUC_PRINTF (4, 5); 41 | BSON_EXPORT (char *) 42 | bson_strerror_r (int err_code, char *buf, size_t buflen); 43 | 44 | 45 | BSON_END_DECLS 46 | 47 | 48 | #endif /* BSON_ERROR_H */ 49 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/rosgraph_msgs/ROSGraphMsgsClockConverter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "CoreMinimal.h" 4 | #include "Conversion/Messages/BaseMessageConverter.h" 5 | #include "rosgraph_msgs/Clock.h" 6 | #include "ROSGraphMsgsClockConverter.generated.h" 7 | 8 | 9 | UCLASS() 10 | class ROSINTEGRATION_API UROSGraphMsgsClockConverter : public UBaseMessageConverter 11 | { 12 | GENERATED_BODY() 13 | 14 | public: 15 | UROSGraphMsgsClockConverter(); 16 | virtual bool ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr &BaseMsg); 17 | virtual bool ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message); 18 | 19 | static bool _bson_extract_child_clock(bson_t *b, FString key, ROSMessages::rosgraph_msgs::Clock *msg, bool LogOnErrors = true) 20 | { 21 | return _bson_extract_child_ros_time(b, key + ".clock", &msg->_Clock, LogOnErrors); 22 | } 23 | 24 | static void _bson_append_child_clock(bson_t *b, const char *key, const ROSMessages::rosgraph_msgs::Clock *msg) 25 | { 26 | bson_t child; 27 | BSON_APPEND_DOCUMENT_BEGIN(b, key, &child); 28 | _bson_append_clock(&child, msg); 29 | bson_append_document_end(b, &child); 30 | } 31 | 32 | static void _bson_append_clock(bson_t *b, const ROSMessages::rosgraph_msgs::Clock *msg) 33 | { 34 | _bson_append_child_ros_time(b, "clock", &msg->_Clock); 35 | } 36 | }; 37 | -------------------------------------------------------------------------------- /ThirdParty/bson/include/linux/bson-version-functions.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | 18 | #if !defined (BSON_INSIDE) && !defined (BSON_COMPILATION) 19 | #error "Only can be included directly." 20 | #endif 21 | 22 | 23 | #ifndef BSON_VERSION_FUNCTIONS_H 24 | #define BSON_VERSION_FUNCTIONS_H 25 | 26 | #include "bson-types.h" 27 | 28 | BSON_API 29 | int bson_get_major_version (void); 30 | BSON_API 31 | int bson_get_minor_version (void); 32 | BSON_API 33 | int bson_get_micro_version (void); 34 | BSON_API 35 | const char *bson_get_version (void); 36 | BSON_API 37 | bool bson_check_version (int required_major, 38 | int required_minor, 39 | int required_micro); 40 | 41 | 42 | #endif /* BSON_VERSION_FUNCTIONS_H */ 43 | -------------------------------------------------------------------------------- /ThirdParty/bson/include/mac/bson-version-functions.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | 18 | #if !defined(BSON_INSIDE) && !defined(BSON_COMPILATION) 19 | #error "Only can be included directly." 20 | #endif 21 | 22 | 23 | #ifndef BSON_VERSION_FUNCTIONS_H 24 | #define BSON_VERSION_FUNCTIONS_H 25 | 26 | #include "bson-types.h" 27 | 28 | BSON_BEGIN_DECLS 29 | 30 | BSON_EXPORT (int) 31 | bson_get_major_version (void); 32 | BSON_EXPORT (int) 33 | bson_get_minor_version (void); 34 | BSON_EXPORT (int) 35 | bson_get_micro_version (void); 36 | BSON_EXPORT (const char *) 37 | bson_get_version (void); 38 | BSON_EXPORT (bool) 39 | bson_check_version (int required_major, int required_minor, int required_micro); 40 | 41 | BSON_END_DECLS 42 | 43 | #endif /* BSON_VERSION_FUNCTIONS_H */ 44 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/rosbridge2cpp/ros_time.cpp: -------------------------------------------------------------------------------- 1 | #include "ros_time.h" 2 | 3 | namespace rosbridge2cpp { 4 | 5 | bool ROSTime::use_sim_time = false; 6 | ROSTime ROSTime::sim_time(0, 0); 7 | 8 | static std::chrono::high_resolution_clock::duration ComputeHRC1970EpocDelta() 9 | { 10 | const std::chrono::high_resolution_clock::time_point hr_time_since_epoch = std::chrono::high_resolution_clock::now(); 11 | const std::chrono::system_clock::time_point time_since_epoch = std::chrono::system_clock::now(); 12 | return time_since_epoch.time_since_epoch() - hr_time_since_epoch.time_since_epoch(); 13 | } 14 | 15 | const std::chrono::high_resolution_clock::duration ROSTime::HRCEpocOffset = ComputeHRC1970EpocDelta(); 16 | 17 | ROSTime ROSTime::now() { 18 | if (use_sim_time) { 19 | return sim_time; 20 | } 21 | 22 | const std::chrono::high_resolution_clock::duration time_since_epoch = HRCEpocOffset + std::chrono::high_resolution_clock::now().time_since_epoch(); 23 | unsigned long seconds_since_epoch = std::chrono::duration_cast(time_since_epoch).count(); 24 | unsigned long long nanoseconds_since_epoch = std::chrono::duration_cast(time_since_epoch).count(); 25 | unsigned long nanosecond_difference = nanoseconds_since_epoch - (seconds_since_epoch * 1000000000ul); 26 | return ROSTime(seconds_since_epoch, nanosecond_difference); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Public/sensor_msgs/NavSatFix.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ROSBaseMsg.h" 4 | #include "std_msgs/Header.h" 5 | #include "NavSatStatus.h" 6 | 7 | // http://docs.ros.org/api/sensor_msgs/html/msg/NavSatFix.html 8 | namespace ROSMessages { 9 | namespace sensor_msgs { 10 | class NavSatFix : public FROSBaseMsg { 11 | public: 12 | NavSatFix() { 13 | _MessageType = "sensor_msgs/NavSatFix"; 14 | } 15 | 16 | // Standard Header 17 | std_msgs::Header header; 18 | 19 | // Satellite Fix Status Information 20 | NavSatStatus status; 21 | 22 | // Latitude [degrees]. Positive is north of equator; negative is south. 23 | double latitude; 24 | // Longitude [degrees]. Positive is east of prime meridian; negative is west. 25 | double longitude; 26 | // Altitude [m]. Positive is above the WGS 84 ellipsoid. 27 | double altitude; 28 | 29 | // Position covariance [m^2] defined relative to a tangential plane through reported position. 30 | TArray position_covariance; 31 | 32 | // Position Covariance Types 33 | enum CovarianceType : uint8 { 34 | COVARIANCE_TYPE_UNKNOWN = 0, 35 | COVARIANCE_TYPE_APPROXIMATED = 1, 36 | COVARIANCE_TYPE_DIAGONAL_KNOWN = 2, 37 | COVARIANCE_TYPE_KNOWN = 3 38 | }; 39 | 40 | // The precision of the position covariance. 41 | CovarianceType position_covariance_type; 42 | }; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/rosbridge2cpp/messages/rosbridge_unadvertise_service_msg.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include "messages/rosbridge_msg.h" 6 | 7 | class ROSBridgeUnadvertiseServiceMsg : public ROSBridgeMsg { 8 | public: 9 | ROSBridgeUnadvertiseServiceMsg() : ROSBridgeMsg() {} 10 | 11 | ROSBridgeUnadvertiseServiceMsg(bool init_opcode) : ROSBridgeMsg() 12 | { 13 | if (init_opcode) 14 | op_ = ROSBridgeMsg::UNADVERTISE_SERVICE; 15 | } 16 | 17 | virtual ~ROSBridgeUnadvertiseServiceMsg() = default; 18 | 19 | 20 | // Unadvertise messages will never be received from the client 21 | // So we don't need to fill this instance from JSON or other wire-level representations 22 | bool FromJSON(const rapidjson::Document &data) = delete; 23 | bool FromBSON(bson_t &bson) = delete; 24 | 25 | rapidjson::Document ToJSON(rapidjson::Document::AllocatorType& alloc) 26 | { 27 | rapidjson::Document d(rapidjson::kObjectType); 28 | d.AddMember("op", getOpCodeString(), alloc); 29 | add_if_value_changed(d, alloc, "id", id_); 30 | add_if_value_changed(d, alloc, "service", service_); 31 | return d; 32 | } 33 | 34 | void ToBSON(bson_t &bson) 35 | { 36 | BSON_APPEND_UTF8(&bson, "op", getOpCodeString().c_str()); 37 | add_if_value_changed(bson, "id", id_); 38 | 39 | add_if_value_changed(bson, "service", service_); 40 | } 41 | 42 | std::string service_; 43 | private: 44 | /* data */ 45 | }; 46 | -------------------------------------------------------------------------------- /ThirdParty/bson/include/linux/bson-error.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | 18 | #ifndef BSON_ERROR_H 19 | #define BSON_ERROR_H 20 | 21 | 22 | #include "bson-compat.h" 23 | #include "bson-macros.h" 24 | #include "bson-types.h" 25 | 26 | 27 | BSON_BEGIN_DECLS 28 | 29 | 30 | #define BSON_ERROR_JSON 1 31 | #define BSON_ERROR_READER 2 32 | 33 | 34 | BSON_API 35 | void bson_set_error (bson_error_t *error, 36 | uint32_t domain, 37 | uint32_t code, 38 | const char *format, 39 | ...) BSON_GNUC_PRINTF (4, 5); 40 | BSON_API 41 | char *bson_strerror_r (int err_code, 42 | char *buf, 43 | size_t buflen); 44 | 45 | 46 | BSON_END_DECLS 47 | 48 | 49 | #endif /* BSON_ERROR_H */ 50 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/rosbridge2cpp/spinlock.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace rosbridge2cpp { 7 | 8 | class spinlock 9 | { 10 | private: 11 | std::atomic_flag lock_; 12 | 13 | public: 14 | spinlock() 15 | { 16 | lock_.clear(std::memory_order_release); 17 | } 18 | 19 | bool try_lock() 20 | { 21 | return !lock_.test_and_set(std::memory_order_acquire); 22 | } 23 | 24 | void lock(const bool sleep = false) 25 | { 26 | while (!try_lock()) 27 | { 28 | if (sleep) 29 | { 30 | std::this_thread::yield(); 31 | } 32 | } 33 | } 34 | 35 | void unlock() 36 | { 37 | lock_.clear(std::memory_order_release); 38 | } 39 | 40 | public: 41 | 42 | template 43 | class scoped_lock 44 | { 45 | private: 46 | spinlock& spinlock_; 47 | scoped_lock(scoped_lock const &); 48 | scoped_lock & operator=(scoped_lock const &); 49 | 50 | public: 51 | explicit scoped_lock(spinlock& sp) : spinlock_(sp) 52 | { 53 | sp.lock(WaitForLongTask); 54 | } 55 | 56 | ~scoped_lock() 57 | { 58 | spinlock_.unlock(); 59 | } 60 | }; 61 | 62 | // assume the other task may take longer, so use sleep/yield 63 | typedef scoped_lock scoped_lock_wait_for_long_task; 64 | // assume the other task finishes soon, so spin wait 65 | typedef scoped_lock scoped_lock_wait_for_short_task; 66 | }; 67 | 68 | } // namespace rosbridge2cpp 69 | -------------------------------------------------------------------------------- /ThirdParty/bson/include/windows/bson-error.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | 18 | #ifndef BSON_ERROR_H 19 | #define BSON_ERROR_H 20 | 21 | 22 | #include "bson-compat.h" 23 | #include "bson-macros.h" 24 | #include "bson-types.h" 25 | 26 | 27 | BSON_BEGIN_DECLS 28 | 29 | 30 | #define BSON_ERROR_JSON 1 31 | #define BSON_ERROR_READER 2 32 | 33 | #define BSON_ERROR_BUFFER_SIZE 64 34 | 35 | 36 | void bson_set_error (bson_error_t *error, 37 | uint32_t domain, 38 | uint32_t code, 39 | const char *format, 40 | ...) BSON_GNUC_PRINTF (4, 5); 41 | char *bson_strerror_r (int err_code, 42 | char *buf, 43 | size_t buflen); 44 | 45 | 46 | BSON_END_DECLS 47 | 48 | 49 | #endif /* BSON_ERROR_H */ 50 | -------------------------------------------------------------------------------- /ThirdParty/bson/include/mac/bson-utf8.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | 18 | #ifndef BSON_UTF8_H 19 | #define BSON_UTF8_H 20 | 21 | 22 | #if !defined(BSON_INSIDE) && !defined(BSON_COMPILATION) 23 | #error "Only can be included directly." 24 | #endif 25 | 26 | 27 | #include "bson-macros.h" 28 | #include "bson-types.h" 29 | 30 | 31 | BSON_BEGIN_DECLS 32 | 33 | 34 | BSON_EXPORT (bool) 35 | bson_utf8_validate (const char *utf8, size_t utf8_len, bool allow_null); 36 | BSON_EXPORT (char *) 37 | bson_utf8_escape_for_json (const char *utf8, ssize_t utf8_len); 38 | BSON_EXPORT (bson_unichar_t) 39 | bson_utf8_get_char (const char *utf8); 40 | BSON_EXPORT (const char *) 41 | bson_utf8_next_char (const char *utf8); 42 | BSON_EXPORT (void) 43 | bson_utf8_from_unichar (bson_unichar_t unichar, char utf8[6], uint32_t *len); 44 | 45 | 46 | BSON_END_DECLS 47 | 48 | 49 | #endif /* BSON_UTF8_H */ 50 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/rosbridge2cpp/messages/rosbridge_advertise_service_msg.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include "messages/rosbridge_msg.h" 6 | 7 | class ROSBridgeAdvertiseServiceMsg : public ROSBridgeMsg{ 8 | public: 9 | ROSBridgeAdvertiseServiceMsg() : ROSBridgeMsg() {} 10 | 11 | ROSBridgeAdvertiseServiceMsg(bool init_opcode) : ROSBridgeMsg() { 12 | if (init_opcode) 13 | op_ = ROSBridgeMsg::ADVERTISE_SERVICE; 14 | } 15 | 16 | virtual ~ROSBridgeAdvertiseServiceMsg() = default; 17 | 18 | // Advertise messages will never be received from the client 19 | // So we don't need to fill this instance from JSON or other wire-level representations 20 | bool FromJSON(const rapidjson::Document &data) = delete; 21 | bool FromBSON(bson_t &bson) = delete; 22 | 23 | rapidjson::Document ToJSON(rapidjson::Document::AllocatorType& alloc) 24 | { 25 | rapidjson::Document d(rapidjson::kObjectType); 26 | d.AddMember("op", getOpCodeString(), alloc); 27 | 28 | add_if_value_changed(d, alloc, "id", id_); 29 | add_if_value_changed(d, alloc, "service", service_); 30 | add_if_value_changed(d, alloc, "type", type_); 31 | return d; 32 | } 33 | 34 | void ToBSON(bson_t &bson) 35 | { 36 | BSON_APPEND_UTF8(&bson, "op", getOpCodeString().c_str()); 37 | 38 | add_if_value_changed(bson, "id", id_); 39 | add_if_value_changed(bson, "service", service_); 40 | add_if_value_changed(bson, "type", type_); 41 | } 42 | 43 | 44 | std::string service_; 45 | std::string type_; 46 | private: 47 | /* data */ 48 | }; 49 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Public/sensor_msgs/PointCloud2.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ROSBaseMsg.h" 4 | #include "std_msgs/Header.h" 5 | 6 | namespace ROSMessages { 7 | namespace sensor_msgs { 8 | class PointCloud2 : public FROSBaseMsg { 9 | public: 10 | 11 | // we use a local PointField definition here instead of sensor_msgs/PointField 12 | // to avoid unecessary bloat by deriving from FROSBaseMsg and it is only used for PointCloud2 msg anyway 13 | struct PointField 14 | { 15 | enum EType 16 | { 17 | INT8 = 1, 18 | UINT8 = 2, 19 | INT16 = 3, 20 | UINT16 = 4, 21 | INT32 = 5, 22 | UINT32 = 6, 23 | FLOAT32 = 7, 24 | FLOAT64 = 8 25 | }; 26 | 27 | FString name; 28 | uint32 offset; 29 | EType datatype; 30 | uint32 count; 31 | }; 32 | 33 | PointCloud2() { 34 | _MessageType = "sensor_msgs/PointCloud2"; 35 | } 36 | 37 | ROSMessages::std_msgs::Header header; 38 | 39 | uint32 height; 40 | uint32 width; 41 | 42 | TArray fields; 43 | 44 | bool is_bigendian; 45 | uint32 point_step; 46 | uint32 row_step; 47 | 48 | // To avoid copy operations of the point data, hand over a pointer to the data. 49 | // Please note, that the memory this pointer points to must be valid until this message has been published. 50 | // When receiving, please note that ROS sends vectors padded to 16 bytes, with 3 floats + 4 byte padding. 51 | const uint8* data_ptr; 52 | 53 | bool is_dense; 54 | }; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/ROSTime.cpp: -------------------------------------------------------------------------------- 1 | #include "ROSTime.h" 2 | #include "ros_time.h" 3 | 4 | using rosbridge2cpp::ROSTime; 5 | 6 | FROSTime FROSTime::Now() { 7 | if (ROSTime::use_sim_time) { 8 | return FROSTime(ROSTime::sim_time.sec_, ROSTime::sim_time.nsec_); 9 | } 10 | 11 | const std::chrono::high_resolution_clock::duration time_since_epoch = ROSTime::HRCEpocOffset + std::chrono::high_resolution_clock::now().time_since_epoch(); 12 | unsigned long seconds_since_epoch = std::chrono::duration_cast(time_since_epoch).count(); 13 | unsigned long long nanoseconds_since_epoch = std::chrono::duration_cast(time_since_epoch).count(); 14 | unsigned long nanosecond_difference = nanoseconds_since_epoch - (seconds_since_epoch * 1000000000ul); 15 | return FROSTime(seconds_since_epoch, nanosecond_difference); 16 | } 17 | 18 | void FROSTime::SetUseSimTime(bool bUseSimTime) 19 | { 20 | ROSTime::use_sim_time = bUseSimTime; 21 | } 22 | 23 | void FROSTime::SetSimTime(const FROSTime& time) 24 | { 25 | ROSTime::sim_time.sec_ = time._Sec; 26 | ROSTime::sim_time.nsec_ = time._NSec; 27 | } 28 | 29 | double FROSTime::GetTimeDelta(const FROSTime& Time1, const FROSTime& Time2) 30 | { 31 | double SecDelta = std::chrono::duration_cast >(std::chrono::seconds(Time2._Sec) - std::chrono::seconds(Time1._Sec)).count(); 32 | double NsecDelta = std::chrono::duration_cast >(std::chrono::nanoseconds(Time2._NSec) - std::chrono::nanoseconds(Time1._NSec)).count(); 33 | return SecDelta + NsecDelta; 34 | } 35 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/rosbridge2cpp/rapidjson/internal/swap.h: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making RapidJSON available. 2 | // 3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. 4 | // 5 | // Licensed under the MIT License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // http://opensource.org/licenses/MIT 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | #ifndef RAPIDJSON_INTERNAL_SWAP_H_ 16 | #define RAPIDJSON_INTERNAL_SWAP_H_ 17 | 18 | #include "../rapidjson.h" 19 | 20 | #if defined(__clang__) 21 | RAPIDJSON_DIAG_PUSH 22 | RAPIDJSON_DIAG_OFF(c++98-compat) 23 | #endif 24 | 25 | RAPIDJSON_NAMESPACE_BEGIN 26 | namespace internal { 27 | 28 | //! Custom swap() to avoid dependency on C++ header 29 | /*! \tparam T Type of the arguments to swap, should be instantiated with primitive C++ types only. 30 | \note This has the same semantics as std::swap(). 31 | */ 32 | template 33 | inline void Swap(T& a, T& b) RAPIDJSON_NOEXCEPT { 34 | T tmp = a; 35 | a = b; 36 | b = tmp; 37 | } 38 | 39 | } // namespace internal 40 | RAPIDJSON_NAMESPACE_END 41 | 42 | #if defined(__clang__) 43 | RAPIDJSON_DIAG_POP 44 | #endif 45 | 46 | #endif // RAPIDJSON_INTERNAL_SWAP_H_ 47 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Classes/SpawnObjectMessage.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | /** 6 | * All the important aspects from visualization_msgs/Marker to spawn some objects in Unreal 7 | */ 8 | class ROSINTEGRATION_API SpawnObjectMessage 9 | { 10 | public: 11 | enum OBJECT_TYPE { 12 | ARROW = 0, 13 | CUBE = 1, 14 | SPHERE = 2, 15 | CYLINDER = 3, 16 | LINE_STRIP = 4, 17 | LINE_LIST = 5, 18 | CUBE_LIST = 6, 19 | SPHERE_LIST = 7, 20 | POINTS = 8, 21 | TEXT_VIEW_FACING = 9, 22 | MESH_RESOURCE = 10, 23 | TRIANGLE_LIST = 11, 24 | }; 25 | 26 | enum ACTION_TYPE { 27 | ACTION_ADD = 0, 28 | ACTION_MODIFY = 0, 29 | ACTION_DELETE = 2, 30 | ACTION_DELETEALL = 3 31 | }; 32 | 33 | SpawnObjectMessage(); 34 | ~SpawnObjectMessage(); 35 | 36 | // An identifier for the object to spawn. Used to modify or delete it with following messages 37 | int32 _Id; 38 | 39 | // The Type of Entity to spawn. See @SpawnObjectMessage::OBJECT_TYPE 40 | int32 _Type; 41 | 42 | // 0 = add/modify, 1 = (deprecated), 2 = delete, New in Indigo 3 = deleteall 43 | int32 _Action; 44 | 45 | struct Pose 46 | { 47 | FVector _Position; 48 | FQuat _Orientation; 49 | }; 50 | Pose _Pose; 51 | 52 | FVector _Scale; 53 | FLinearColor _Color; 54 | 55 | // Not implemented 56 | uint32 _Lifetime; 57 | // Not implemented 58 | bool _FrameLocked; 59 | 60 | // TODO Points 61 | // TODO Colors 62 | 63 | // When using _Type==OBJECT_TYPE::MESH_RESOURCE, this string shall hold the path to the material to apply. 64 | FString _Text; 65 | // When using _Type==OBJECT_TYPE::MESH_RESOURCE, this string shall hold the path to the mesh to set. 66 | FString _MeshResource; 67 | // TODO MeshUseEmbeddedMaterials 68 | }; 69 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Public/sensor_msgs/JointState.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ROSBaseMsg.h" 4 | #include "std_msgs/Header.h" 5 | 6 | namespace ROSMessages { 7 | namespace sensor_msgs { 8 | class JointState : public FROSBaseMsg { 9 | public: 10 | JointState() { 11 | _MessageType = "sensor_msgs/JointState"; 12 | } 13 | 14 | /** 15 | # This is a message that holds data to describe the state of a set of torque controlled joints. 16 | # 17 | # The state of each joint(revolute or prismatic) is defined by : 18 | # * the position of the joint (rad or m), 19 | # * the velocity of the joint (rad/s or m/s) and 20 | # * the effort that is applied in the joint (Nm or N). 21 | # 22 | # Each joint is uniquely identified by its name 23 | # The header specifies the time at which the joint states were recorded.All the joint states 24 | # in one message have to be recorded at the same time. 25 | # 26 | # This message consists of a multiple arrays, one for each part of the joint state. 27 | # The goal is to make each of the fields optional.When e.g.your joints have no 28 | # effort associated with them, you can leave the effort array empty. 29 | # 30 | # All arrays in this message should have the same size, or be empty. 31 | # This is the only way to uniquely associate the joint name with the correct 32 | # states. 33 | */ 34 | ROSMessages::std_msgs::Header header; 35 | 36 | TArray name; // the joint name 37 | TArray position; // the position of the joint (rad or m), 38 | TArray velocity; // the velocity of the joint (rad/s or m/s) 39 | TArray effort; // the effort that is applied in the joint (Nm or N) 40 | }; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/geometry_msgs/GeometryMsgsPointConverter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include "Conversion/Messages/BaseMessageConverter.h" 5 | #include "geometry_msgs/Point.h" 6 | #include "GeometryMsgsPointConverter.generated.h" 7 | 8 | 9 | UCLASS() 10 | class ROSINTEGRATION_API UGeometryMsgsPointConverter : public UBaseMessageConverter 11 | { 12 | GENERATED_BODY() 13 | 14 | public: 15 | UGeometryMsgsPointConverter(); 16 | virtual bool ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr &BaseMsg); 17 | virtual bool ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message); 18 | 19 | 20 | static bool _bson_extract_child_point(bson_t *b, FString key, ROSMessages::geometry_msgs::Point *msg, bool LogOnErrors = true) 21 | { 22 | bool KeyFound = false; 23 | 24 | msg->x = GetDoubleFromBSON(key + ".x", b, KeyFound, LogOnErrors); if (!KeyFound) return false; 25 | msg->y = GetDoubleFromBSON(key + ".y", b, KeyFound, LogOnErrors); if (!KeyFound) return false; 26 | msg->z = GetDoubleFromBSON(key + ".z", b, KeyFound, LogOnErrors); if (!KeyFound) return false; 27 | return true; 28 | } 29 | 30 | 31 | static void _bson_append_child_point(bson_t *b, const char *key, const ROSMessages::geometry_msgs::Point *msg) 32 | { 33 | bson_t child; 34 | BSON_APPEND_DOCUMENT_BEGIN(b, key, &child); 35 | _bson_append_point(&child, msg); 36 | bson_append_document_end(b, &child); 37 | } 38 | 39 | 40 | static void _bson_append_point(bson_t *b, const ROSMessages::geometry_msgs::Point *msg) 41 | { 42 | BSON_APPEND_DOUBLE(b, "x", msg->x); 43 | BSON_APPEND_DOUBLE(b, "y", msg->y); 44 | BSON_APPEND_DOUBLE(b, "z", msg->z); 45 | } 46 | }; 47 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/geometry_msgs/GeometryMsgsVector3Converter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "CoreMinimal.h" 4 | #include "Conversion/Messages/BaseMessageConverter.h" 5 | #include "geometry_msgs/Vector3.h" 6 | #include "GeometryMsgsVector3Converter.generated.h" 7 | 8 | 9 | UCLASS() 10 | class ROSINTEGRATION_API UGeometryMsgsVector3Converter: public UBaseMessageConverter 11 | { 12 | GENERATED_BODY() 13 | 14 | public: 15 | UGeometryMsgsVector3Converter(); 16 | virtual bool ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr &BaseMsg); 17 | virtual bool ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message); 18 | 19 | static bool _bson_extract_child_vector3(bson_t *b, FString key, ROSMessages::geometry_msgs::Vector3 *msg, bool LogOnErrors = true) 20 | { 21 | bool KeyFound = false; 22 | msg->x = GetDoubleFromBSON(key + ".x", b, KeyFound, LogOnErrors); if (!KeyFound) return false; 23 | msg->y = GetDoubleFromBSON(key + ".y", b, KeyFound, LogOnErrors); if (!KeyFound) return false; 24 | msg->z = GetDoubleFromBSON(key + ".z", b, KeyFound, LogOnErrors); if (!KeyFound) return false; 25 | return true; 26 | } 27 | 28 | static void _bson_append_child_vector3(bson_t *b, const char *key, const ROSMessages::geometry_msgs::Vector3 *msg) 29 | { 30 | bson_t child; 31 | BSON_APPEND_DOCUMENT_BEGIN(b, key, &child); 32 | _bson_append_vector3(&child, msg); 33 | bson_append_document_end(b, &child); 34 | } 35 | 36 | 37 | static void _bson_append_vector3(bson_t *b, const ROSMessages::geometry_msgs::Vector3 *msg) 38 | { 39 | BSON_APPEND_DOUBLE(b, "x", msg->x); 40 | BSON_APPEND_DOUBLE(b, "y", msg->y); 41 | BSON_APPEND_DOUBLE(b, "z", msg->z); 42 | } 43 | }; -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Services/rospy_tutorials/RospyTutorialsAddTwoIntsResponseConverter.cpp: -------------------------------------------------------------------------------- 1 | #include "Conversion/Services/rospy_tutorials/RospyTutorialsAddTwoIntsResponseConverter.h" 2 | 3 | #include "rospy_tutorials/AddTwoIntsResponse.h" 4 | #include 5 | 6 | 7 | URospyTutorialsAddTwoIntsResponseConverter::URospyTutorialsAddTwoIntsResponseConverter() 8 | { 9 | _ServiceType = "rospy_tutorials/AddTwoInts"; 10 | } 11 | 12 | bool URospyTutorialsAddTwoIntsResponseConverter::ConvertIncomingResponse(const ROSBridgeServiceResponseMsg &res, TSharedRef> Response) 13 | { 14 | bool key_found = false; 15 | *Response = MakeShareable(new rospy_tutorials::FAddTwoIntsResponse); 16 | auto ServiceResponse = StaticCastSharedPtr(*Response); 17 | 18 | ServiceResponse->_Result = res.result_; 19 | 20 | ServiceResponse->_sum = rosbridge2cpp::Helper::get_int32_by_key("values.sum", *res.full_msg_bson_, key_found); 21 | if (!key_found) { 22 | UE_LOG(LogTemp, Error, TEXT("Key values.sum not present in data")); 23 | return false; 24 | } 25 | return true; 26 | } 27 | 28 | bool URospyTutorialsAddTwoIntsResponseConverter::ConvertOutgoingResponse(TSharedPtr Response, ROSBridgeServiceResponseMsg &res) 29 | { 30 | auto ServiceResponse = StaticCastSharedPtr(Response); 31 | 32 | res.result_ = ServiceResponse->_Result; 33 | BSON_APPEND_INT32(res.values_bson_, "sum", ServiceResponse->_sum); 34 | return true; 35 | } 36 | 37 | TSharedPtr URospyTutorialsAddTwoIntsResponseConverter::AllocateConcreteResponse() 38 | { 39 | return MakeShareable(new rospy_tutorials::FAddTwoIntsResponse); 40 | } -------------------------------------------------------------------------------- /ThirdParty/bson/include/windows/bson-utf8.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | 18 | #ifndef BSON_UTF8_H 19 | #define BSON_UTF8_H 20 | 21 | 22 | #if !defined (BSON_INSIDE) && !defined (BSON_COMPILATION) 23 | # error "Only can be included directly." 24 | #endif 25 | 26 | 27 | #include "bson-macros.h" 28 | #include "bson-types.h" 29 | 30 | 31 | BSON_BEGIN_DECLS 32 | 33 | 34 | bool bson_utf8_validate (const char *utf8, 35 | size_t utf8_len, 36 | bool allow_null); 37 | char *bson_utf8_escape_for_json (const char *utf8, 38 | ssize_t utf8_len); 39 | bson_unichar_t bson_utf8_get_char (const char *utf8); 40 | const char *bson_utf8_next_char (const char *utf8); 41 | void bson_utf8_from_unichar (bson_unichar_t unichar, 42 | char utf8[6], 43 | uint32_t *len); 44 | 45 | 46 | BSON_END_DECLS 47 | 48 | 49 | #endif /* BSON_UTF8_H */ 50 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/geometry_msgs/GeometryMsgsTwistConverter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "CoreMinimal.h" 4 | #include "Conversion/Messages/BaseMessageConverter.h" 5 | #include "Conversion/Messages/geometry_msgs/GeometryMsgsVector3Converter.h" 6 | #include "geometry_msgs/Twist.h" 7 | #include "GeometryMsgsTwistConverter.generated.h" 8 | 9 | 10 | UCLASS() 11 | class ROSINTEGRATION_API UGeometryMsgsTwistConverter : public UBaseMessageConverter 12 | { 13 | GENERATED_BODY() 14 | 15 | public: 16 | UGeometryMsgsTwistConverter(); 17 | virtual bool ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr &BaseMsg); 18 | virtual bool ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message); 19 | 20 | static bool _bson_extract_child_twist(bson_t *b, FString key, ROSMessages::geometry_msgs::Twist *msg, bool LogOnErrors = true) 21 | { 22 | if (!UGeometryMsgsVector3Converter::_bson_extract_child_vector3(b, key + ".linear", &msg->linear, LogOnErrors)) return false; 23 | if (!UGeometryMsgsVector3Converter::_bson_extract_child_vector3(b, key + ".angular", &msg->angular, LogOnErrors)) return false; 24 | 25 | return true; 26 | } 27 | 28 | static void _bson_append_child_twist(bson_t *b, const char *key, const ROSMessages::geometry_msgs::Twist *msg) 29 | { 30 | bson_t child; 31 | BSON_APPEND_DOCUMENT_BEGIN(b, key, &child); 32 | _bson_append_twist(&child, msg); 33 | bson_append_document_end(b, &child); 34 | } 35 | 36 | static void _bson_append_twist(bson_t *b, const ROSMessages::geometry_msgs::Twist *msg) 37 | { 38 | UGeometryMsgsVector3Converter::_bson_append_child_vector3(b, "linear", &msg->linear); 39 | UGeometryMsgsVector3Converter::_bson_append_child_vector3(b, "angular", &msg->angular); 40 | } 41 | }; -------------------------------------------------------------------------------- /ThirdParty/bson/include/mac/bson-decimal128.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | 18 | #ifndef BSON_DECIMAL128_H 19 | #define BSON_DECIMAL128_H 20 | 21 | 22 | #if !defined(BSON_INSIDE) && !defined(BSON_COMPILATION) 23 | #error "Only can be included directly." 24 | #endif 25 | 26 | #include 27 | 28 | #include "bson-macros.h" 29 | #include "bson-config.h" 30 | #include "bson-types.h" 31 | 32 | 33 | /** 34 | * BSON_DECIMAL128_STRING: 35 | * 36 | * The length of a decimal128 string (with null terminator). 37 | * 38 | * 1 for the sign 39 | * 35 for digits and radix 40 | * 2 for exponent indicator and sign 41 | * 4 for exponent digits 42 | */ 43 | #define BSON_DECIMAL128_STRING 43 44 | #define BSON_DECIMAL128_INF "Infinity" 45 | #define BSON_DECIMAL128_NAN "NaN" 46 | 47 | 48 | BSON_BEGIN_DECLS 49 | 50 | BSON_EXPORT (void) 51 | bson_decimal128_to_string (const bson_decimal128_t *dec, char *str); 52 | 53 | 54 | /* Note: @string must be ASCII characters only! */ 55 | BSON_EXPORT (bool) 56 | bson_decimal128_from_string (const char *string, bson_decimal128_t *dec); 57 | 58 | 59 | BSON_END_DECLS 60 | 61 | 62 | #endif /* BSON_DECIMAL128_H */ 63 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Public/sensor_msgs/LaserScan.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ROSBaseMsg.h" 4 | #include "std_msgs/Header.h" 5 | 6 | namespace ROSMessages { 7 | namespace sensor_msgs { 8 | 9 | /** Single scan from a planar laser range-finder. 10 | * 11 | * If you have another ranging device with different behavior(e.g.a sonar 12 | * array), please find or create a different message, since applications 13 | * will make fairly laser - specific assumptions about this data 14 | */ 15 | class LaserScan : public FROSBaseMsg { 16 | public: 17 | LaserScan() { 18 | _MessageType = "sensor_msgs/LaserScan"; 19 | } 20 | 21 | 22 | /** timestamp in the header is the acquisition time of the first ray in the scan. 23 | * 24 | * In frame frame_id, angles are measured around 25 | * the positive Z axis(counterclockwise, if Z is up) 26 | * with zero angle being forward along the x axis 27 | */ 28 | ROSMessages::std_msgs::Header header; 29 | 30 | float angle_min; // start angle of the scan[rad] 31 | float angle_max; // end angle of the scan[rad] 32 | float angle_increment; // angular distance between measurements[rad] 33 | 34 | float time_increment; // time between measurements[seconds] - if your scanner is moving, this will be used in interpolating position of 3d points 35 | float scan_time; // time between scans[seconds] 36 | 37 | float range_min; // minimum range value[m] 38 | float range_max; // maximum range value[m] 39 | 40 | TArray ranges; // range data[m](Note: values < range_min or > range_max should be discarded) 41 | TArray intensities; // intensity data[device - specific units]. If your 42 | // device does not provide intensities, please leave 43 | // the array empty. 44 | }; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/sensor_msgs/SensorMsgsNavSatStatusConverter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "CoreMinimal.h" 4 | #include "Conversion/Messages/BaseMessageConverter.h" 5 | #include "sensor_msgs/NavSatStatus.h" 6 | #include "SensorMsgsNavSatStatusConverter.generated.h" 7 | 8 | UCLASS() 9 | class ROSINTEGRATION_API USensorMsgsNavSatStatusConverter : public UBaseMessageConverter 10 | { 11 | GENERATED_BODY() 12 | 13 | public: 14 | USensorMsgsNavSatStatusConverter(); 15 | virtual bool ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr &BaseMsg); 16 | virtual bool ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message); 17 | 18 | static bool _bson_extract_child_nav_sat_status(bson_t* b, FString key, ROSMessages::sensor_msgs::NavSatStatus* msg, bool LogOnErrors = true) 19 | { 20 | bool KeyFound = false; 21 | 22 | msg->status = static_cast(GetInt32FromBSON(key + ".status", b, KeyFound, LogOnErrors)); 23 | if (!KeyFound) return false; 24 | 25 | msg->service = static_cast(GetInt32FromBSON(key + ".service", b, KeyFound, LogOnErrors)); 26 | if (!KeyFound) return false; 27 | 28 | return true; 29 | } 30 | 31 | static void _bson_append_child_nav_sat_status(bson_t* b, const char *key, const ROSMessages::sensor_msgs::NavSatStatus* msg) 32 | { 33 | bson_t child; 34 | BSON_APPEND_DOCUMENT_BEGIN(b, key, &child); 35 | _bson_append_nav_sat_status(&child, msg); 36 | bson_append_document_end(b, &child); 37 | } 38 | 39 | static void _bson_append_nav_sat_status(bson_t* b, const ROSMessages::sensor_msgs::NavSatStatus* msg) 40 | { 41 | BSON_APPEND_INT32(b, "status", msg->status); 42 | BSON_APPEND_INT32(b, "service", msg->service); 43 | } 44 | }; -------------------------------------------------------------------------------- /Source/ROSIntegration/Public/sensor_msgs/Image.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ROSBaseMsg.h" 4 | #include "std_msgs/Header.h" 5 | 6 | namespace ROSMessages { 7 | namespace sensor_msgs { 8 | class Image : public FROSBaseMsg { 9 | public: 10 | Image() { 11 | _MessageType = "sensor_msgs/Image"; 12 | } 13 | 14 | /** Header timestamp should be acquisition time of image 15 | * Header frame_id should be optical frame of camera 16 | * origin of frame should be optical center of camera 17 | * +x should point to the right in the image 18 | * +y should point down in the image 19 | * +z should point into to plane of the image 20 | * If the frame_id here and the frame_id of the CameraInfo 21 | * message associated with the image conflict 22 | * the behavior is undefined 23 | */ 24 | ROSMessages::std_msgs::Header header; 25 | 26 | uint32 height; // image height, that is, number of rows 27 | uint32 width; // image width, that is, number of columns 28 | 29 | // The legal values for encoding are in file src / image_encodings.cpp 30 | // If you want to standardize a new string format, join 31 | // ros - users@lists.sourceforge.net and send an email proposing a new encoding. 32 | FString encoding; // Encoding of pixels -- channel meaning, ordering, size taken from the list of strings in include / sensor_msgs / image_encodings.h 33 | 34 | uint8 is_bigendian; // is this data bigendian? 35 | uint32 step; // Full row length in bytes 36 | 37 | // To avoid copy operations of the image data, 38 | // hand over a pointer to the uint8 data. 39 | // Please note, that the memory this pointer points to must be valid until this message has been published. 40 | const uint8* data; // actual matrix data, size is (step * rows) 41 | }; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /ThirdParty/bson/include/linux/bson-utf8.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | 18 | #ifndef BSON_UTF8_H 19 | #define BSON_UTF8_H 20 | 21 | 22 | #if !defined (BSON_INSIDE) && !defined (BSON_COMPILATION) 23 | # error "Only can be included directly." 24 | #endif 25 | 26 | 27 | #include "bson-macros.h" 28 | #include "bson-types.h" 29 | 30 | 31 | BSON_BEGIN_DECLS 32 | 33 | 34 | BSON_API 35 | bool bson_utf8_validate (const char *utf8, 36 | size_t utf8_len, 37 | bool allow_null); 38 | BSON_API 39 | char *bson_utf8_escape_for_json (const char *utf8, 40 | ssize_t utf8_len); 41 | BSON_API 42 | bson_unichar_t bson_utf8_get_char (const char *utf8); 43 | BSON_API 44 | const char *bson_utf8_next_char (const char *utf8); 45 | BSON_API 46 | void bson_utf8_from_unichar (bson_unichar_t unichar, 47 | char utf8[6], 48 | uint32_t *len); 49 | 50 | 51 | BSON_END_DECLS 52 | 53 | 54 | #endif /* BSON_UTF8_H */ 55 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/geometry_msgs/GeometryMsgsPoseStampedConverter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "CoreMinimal.h" 4 | #include "Conversion/Messages/BaseMessageConverter.h" 5 | #include "geometry_msgs/PoseStamped.h" 6 | #include "Conversion/Messages/std_msgs/StdMsgsHeaderConverter.h" 7 | #include "Conversion/Messages/geometry_msgs/GeometryMsgsPoseConverter.h" 8 | #include "GeometryMsgsPoseStampedConverter.generated.h" 9 | 10 | 11 | UCLASS() 12 | class ROSINTEGRATION_API UGeometryMsgsPoseStampedConverter : public UBaseMessageConverter 13 | { 14 | GENERATED_BODY() 15 | 16 | public: 17 | UGeometryMsgsPoseStampedConverter(); 18 | virtual bool ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr &BaseMsg); 19 | virtual bool ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message); 20 | 21 | static bool _bson_extract_child_pose_stamped(bson_t *b, FString key, ROSMessages::geometry_msgs::PoseStamped * msg, bool LogOnErrors = true) 22 | { 23 | if (!UStdMsgsHeaderConverter::_bson_extract_child_header(b, key + ".header", &msg->header)) return false; 24 | if (!UGeometryMsgsPoseConverter::_bson_extract_child_pose(b, key + ".pose", &msg->pose)) return false; 25 | return true; 26 | } 27 | 28 | static void _bson_append_child_pose_stamped(bson_t *b, const char *key, const ROSMessages::geometry_msgs::PoseStamped * msg) 29 | { 30 | bson_t child; 31 | BSON_APPEND_DOCUMENT_BEGIN(b, key, &child); 32 | _bson_append_pose_stamped(&child, msg); 33 | bson_append_document_end(b, &child); 34 | } 35 | 36 | static void _bson_append_pose_stamped(bson_t *b, const ROSMessages::geometry_msgs::PoseStamped * msg) 37 | { 38 | UStdMsgsHeaderConverter::_bson_append_child_header(b, "header", &msg->header); 39 | UGeometryMsgsPoseConverter::_bson_append_child_pose(b, "pose", &msg->pose); 40 | } 41 | }; -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/std_msgs/StdMsgsColorRGBAConverter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "CoreMinimal.h" 4 | #include "Conversion/Messages/BaseMessageConverter.h" 5 | #include "std_msgs/ColorRGBA.h" 6 | #include "StdMsgsColorRGBAConverter.generated.h" 7 | 8 | 9 | UCLASS() 10 | class ROSINTEGRATION_API UStdMsgsColorRGBAConverter: public UBaseMessageConverter 11 | { 12 | GENERATED_BODY() 13 | 14 | public: 15 | UStdMsgsColorRGBAConverter(); 16 | virtual bool ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr &BaseMsg); 17 | virtual bool ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message); 18 | 19 | static bool _bson_extract_child_color_rgba(bson_t *b, FString key, ROSMessages::std_msgs::ColorRGBA *msg, bool LogOnErrors = true) 20 | { 21 | bool KeyFound = false; 22 | msg->r = GetDoubleFromBSON(key + ".r", b, KeyFound, LogOnErrors); if (!KeyFound) return false; 23 | msg->g = GetDoubleFromBSON(key + ".g", b, KeyFound, LogOnErrors); if (!KeyFound) return false; 24 | msg->b = GetDoubleFromBSON(key + ".b", b, KeyFound, LogOnErrors); if (!KeyFound) return false; 25 | msg->a = GetDoubleFromBSON(key + ".a", b, KeyFound, LogOnErrors); if (!KeyFound) return false; 26 | return true; 27 | } 28 | 29 | static void _bson_append_child_color_rgba(bson_t* b, const char* key, const ROSMessages::std_msgs::ColorRGBA* msg) 30 | { 31 | bson_t child; 32 | BSON_APPEND_DOCUMENT_BEGIN(b, key, &child); 33 | _bson_append_color_rgba(&child, msg); 34 | bson_append_document_end(b, &child); 35 | } 36 | 37 | static void _bson_append_color_rgba(bson_t *b, const ROSMessages::std_msgs::ColorRGBA *msg) 38 | { 39 | BSON_APPEND_DOUBLE(b, "r", msg->r); 40 | BSON_APPEND_DOUBLE(b, "g", msg->g); 41 | BSON_APPEND_DOUBLE(b, "b", msg->b); 42 | BSON_APPEND_DOUBLE(b, "a", msg->a); 43 | } 44 | }; 45 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/rosbridge2cpp/WebsocketConnection.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include // std::function 4 | 5 | #include 6 | 7 | //#include Websocket stuff 8 | #include 9 | #include 10 | #include "itransport_layer.h" 11 | #include "types.h" 12 | // 13 | 14 | #include "rapidjson/document.h" 15 | using json = rapidjson::Document; 16 | 17 | #include "rapidjson/writer.h" 18 | #include "rapidjson/stringbuffer.h" 19 | #include "IWebSocket.h" 20 | 21 | #pragma warning(disable:4265) 22 | class WebsocketConnection : public rosbridge2cpp::ITransportLayer { 23 | public: 24 | WebsocketConnection(); //constructor 25 | ~WebsocketConnection(); //deconstructor 26 | 27 | 28 | bool Init(std::string ip_addr, int port); 29 | bool SendMessage(std::string data); 30 | bool SendMessage(const uint8_t* data, unsigned int length); 31 | void RegisterIncomingMessageCallback(std::function fun); 32 | void RegisterIncomingMessageCallback(std::function fun); 33 | void RegisterErrorCallback(std::function fun); 34 | void ReportError(rosbridge2cpp::TransportError err); 35 | void SetTransportMode(rosbridge2cpp::ITransportLayer::TransportMode); 36 | 37 | bool IsHealthy() const; 38 | 39 | private: 40 | void OnConnectionError(const FString& Error); 41 | void OnClosed(int32 StatusCode, const FString& Reason, bool bWasClean); 42 | void OnRawMessage(const void*, size_t size, size_t bytes_remaining); 43 | void OnMessage(const FString& msg); 44 | 45 | 46 | TSharedPtr WebSocket; 47 | 48 | bool bson_only_mode_ = false; 49 | std::function _incoming_message_callback; 50 | std::function incoming_message_callback_bson_; 51 | std::function _error_callback; 52 | }; 53 | #pragma warning(default:4265) 54 | -------------------------------------------------------------------------------- /ThirdParty/bson/include/linux/bson-decimal128.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | 18 | #ifndef BSON_DECIMAL128_H 19 | #define BSON_DECIMAL128_H 20 | 21 | 22 | #if !defined (BSON_INSIDE) && !defined (BSON_COMPILATION) 23 | # error "Only can be included directly." 24 | #endif 25 | 26 | #include 27 | 28 | #include "bson-macros.h" 29 | #include "bson-config.h" 30 | #include "bson-types.h" 31 | 32 | 33 | /** 34 | * BSON_DECIMAL128_STRING: 35 | * 36 | * The length of a decimal128 string (with null terminator). 37 | * 38 | * 1 for the sign 39 | * 35 for digits and radix 40 | * 2 for exponent indicator and sign 41 | * 4 for exponent digits 42 | */ 43 | #define BSON_DECIMAL128_STRING 43 44 | #define BSON_DECIMAL128_INF "Infinity" 45 | #define BSON_DECIMAL128_NAN "NaN" 46 | 47 | 48 | BSON_BEGIN_DECLS 49 | 50 | BSON_API 51 | void 52 | bson_decimal128_to_string (const bson_decimal128_t *dec, 53 | char *str); 54 | 55 | 56 | /* Note: @string must be ASCII characters only! */ 57 | BSON_API 58 | bool 59 | bson_decimal128_from_string (const char *string, 60 | bson_decimal128_t *dec); 61 | 62 | 63 | BSON_END_DECLS 64 | 65 | 66 | #endif /* BSON_DECIMAL128_H */ 67 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/geometry_msgs/GeometryMsgsPoseConverter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include "Conversion/Messages/BaseMessageConverter.h" 5 | #include "Conversion/Messages/geometry_msgs/GeometryMsgsPointConverter.h" 6 | #include "Conversion/Messages/geometry_msgs/GeometryMsgsQuaternionConverter.h" 7 | #include "geometry_msgs/Pose.h" 8 | #include "GeometryMsgsPoseConverter.generated.h" 9 | 10 | 11 | UCLASS() 12 | class ROSINTEGRATION_API UGeometryMsgsPoseConverter : public UBaseMessageConverter 13 | { 14 | GENERATED_BODY() 15 | 16 | public: 17 | UGeometryMsgsPoseConverter(); 18 | virtual bool ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr &BaseMsg); 19 | virtual bool ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message); 20 | 21 | static bool _bson_extract_child_pose(bson_t *b, FString key, ROSMessages::geometry_msgs::Pose *msg, bool LogOnErrors = true) 22 | { 23 | if (!UGeometryMsgsPointConverter::_bson_extract_child_point(b, key + ".position", &msg->position, LogOnErrors)) return false; 24 | if (!UGeometryMsgsQuaternionConverter::_bson_extract_child_quaternion(b, key + ".orientation", &msg->orientation, LogOnErrors)) return false; 25 | 26 | return true; 27 | } 28 | 29 | static void _bson_append_child_pose(bson_t *b, const char *key, const ROSMessages::geometry_msgs::Pose *msg) 30 | { 31 | bson_t child; 32 | BSON_APPEND_DOCUMENT_BEGIN(b, key, &child); 33 | _bson_append_pose(&child, msg); 34 | bson_append_document_end(b, &child); 35 | } 36 | 37 | static void _bson_append_pose(bson_t *b, const ROSMessages::geometry_msgs::Pose *msg) 38 | { 39 | UGeometryMsgsPointConverter::_bson_append_child_point(b, "position", &msg->position); 40 | UGeometryMsgsQuaternionConverter::_bson_append_child_quaternion(b, "orientation", &msg->orientation); 41 | } 42 | }; 43 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/geometry_msgs/GeometryMsgsTwistStampedConverter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "CoreMinimal.h" 4 | #include "Conversion/Messages/BaseMessageConverter.h" 5 | #include "Conversion/Messages/std_msgs/StdMsgsHeaderConverter.h" 6 | #include "Conversion/Messages/geometry_msgs/GeometryMsgsTwistConverter.h" 7 | #include "geometry_msgs/TwistStamped.h" 8 | #include "GeometryMsgsTwistStampedConverter.generated.h" 9 | 10 | 11 | UCLASS() 12 | class ROSINTEGRATION_API UGeometryMsgsTwistStampedConverter : public UBaseMessageConverter 13 | { 14 | GENERATED_BODY() 15 | 16 | public: 17 | UGeometryMsgsTwistStampedConverter(); 18 | virtual bool ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr &BaseMsg); 19 | virtual bool ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message); 20 | 21 | static bool _bson_extract_child_twist_stamped(bson_t *b, FString key, ROSMessages::geometry_msgs::TwistStamped *msg, bool LogOnErrors = true) 22 | { 23 | if (!UStdMsgsHeaderConverter::_bson_extract_child_header(b, key + ".header", &msg->header)) return false; 24 | if (!UGeometryMsgsTwistConverter::_bson_extract_child_twist(b, key + ".twist", &msg->twist, LogOnErrors)) return false; 25 | 26 | return true; 27 | } 28 | 29 | static void _bson_append_child_twist_stamped(bson_t *b, const char *key, const ROSMessages::geometry_msgs::TwistStamped *msg) 30 | { 31 | bson_t child; 32 | BSON_APPEND_DOCUMENT_BEGIN(b, key, &child); 33 | _bson_append_twist_stamped(&child, msg); 34 | bson_append_document_end(b, &child); 35 | } 36 | 37 | static void _bson_append_twist_stamped(bson_t *b, const ROSMessages::geometry_msgs::TwistStamped *msg) 38 | { 39 | UStdMsgsHeaderConverter::_bson_append_child_header(b, "header", &msg->header); 40 | UGeometryMsgsTwistConverter::_bson_append_child_twist(b, "twist", &msg->twist); 41 | } 42 | }; -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/rosbridge2cpp/messages/rosbridge_advertise_msg.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include "messages/rosbridge_msg.h" 6 | 7 | class ROSBridgeAdvertiseMsg : public ROSBridgeMsg { 8 | public: 9 | ROSBridgeAdvertiseMsg () : ROSBridgeMsg() {} 10 | 11 | ROSBridgeAdvertiseMsg(bool init_opcode) : ROSBridgeMsg() 12 | { 13 | if (init_opcode) 14 | op_ = ROSBridgeMsg::ADVERTISE; 15 | } 16 | 17 | virtual ~ROSBridgeAdvertiseMsg() = default; 18 | 19 | // Advertise messages will never be received from the client 20 | // So we don't need to fill this instance from JSON or other wire-level representations 21 | bool FromJSON(const rapidjson::Document &data) = delete; 22 | bool FromBSON(bson_t &bson) = delete; 23 | 24 | rapidjson::Document ToJSON(rapidjson::Document::AllocatorType& alloc) 25 | { 26 | rapidjson::Document d(rapidjson::kObjectType); 27 | d.AddMember("op", getOpCodeString(), alloc); 28 | 29 | add_if_value_changed(d, alloc, "id", id_); 30 | add_if_value_changed(d, alloc, "topic", topic_); 31 | add_if_value_changed(d, alloc, "type", type_); 32 | add_if_value_changed(d, alloc, "queue_size", queue_size_); 33 | 34 | d.AddMember("latch", latch_, alloc); 35 | 36 | return d; 37 | } 38 | 39 | void ToBSON(bson_t &bson) 40 | { 41 | BSON_APPEND_UTF8(&bson, "op", getOpCodeString().c_str()); 42 | 43 | add_if_value_changed(bson, "id", id_); 44 | add_if_value_changed(bson, "topic", topic_); 45 | add_if_value_changed(bson, "type", type_); 46 | 47 | add_if_value_changed(bson, "queue_size", queue_size_); 48 | 49 | //d.AddMember("latch", latch_, alloc); 50 | BSON_APPEND_BOOL(&bson, "latch", latch_); 51 | } 52 | 53 | std::string topic_; 54 | std::string type_; 55 | //std::string compression_ = "none"; 56 | //int throttle_rate_ = 0; 57 | bool latch_ = false; 58 | int queue_size_ = -1; 59 | private: 60 | /* data */ 61 | }; 62 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/std_msgs/StdMsgsFloat32MultiArrayConverter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "CoreMinimal.h" 4 | #include "Conversion/Messages/BaseMessageConverter.h" 5 | #include "std_msgs/Float32MultiArray.h" 6 | #include "Conversion/Messages/std_msgs/StdMsgsMultiArrayLayoutConverter.h" 7 | #include "StdMsgsFloat32MultiArrayConverter.generated.h" 8 | 9 | 10 | UCLASS() 11 | class ROSINTEGRATION_API UStdMsgsFloat32MultiArrayConverter : public UBaseMessageConverter 12 | { 13 | GENERATED_BODY() 14 | 15 | public: 16 | UStdMsgsFloat32MultiArrayConverter(); 17 | virtual bool ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr &BaseMsg); 18 | virtual bool ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message); 19 | 20 | static bool _bson_extract_child_float_multi_array(bson_t *b, FString key, ROSMessages::std_msgs::Float32MultiArray *msg, bool LogOnErrors = true) 21 | { 22 | bool KeyFound = false; 23 | 24 | KeyFound = UStdMsgsMultiArrayLayoutConverter::_bson_extract_child_multi_array_layout(b, key + ".layout", &msg->layout, LogOnErrors); if (!KeyFound) return false; 25 | msg->data = GetFloatTArrayFromBSON(key + ".data", b, KeyFound, LogOnErrors); if (!KeyFound) return false; 26 | 27 | return true; 28 | } 29 | 30 | static void _bson_append_child_float_multi_array(bson_t *b, const char *key, const ROSMessages::std_msgs::Float32MultiArray *msg) 31 | { 32 | bson_t child; 33 | BSON_APPEND_DOCUMENT_BEGIN(b, key, &child); 34 | _bson_append_float_multi_array(&child, msg); 35 | bson_append_document_end(b, &child); 36 | } 37 | 38 | static void _bson_append_float_multi_array(bson_t *b, const ROSMessages::std_msgs::Float32MultiArray *msg) 39 | { 40 | UStdMsgsMultiArrayLayoutConverter::_bson_append_child_multi_array_layout(b, "layout", &msg->layout); 41 | _bson_append_float_tarray(b, "data", msg->data); 42 | } 43 | }; -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/std_msgs/StdMsgsMultiArrayDimensionConverter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "CoreMinimal.h" 4 | #include "Conversion/Messages/BaseMessageConverter.h" 5 | #include "std_msgs/MultiArrayDimension.h" 6 | #include "StdMsgsMultiArrayDimensionConverter.generated.h" 7 | 8 | 9 | UCLASS() 10 | class ROSINTEGRATION_API UStdMsgsMultiArrayDimensionConverter : public UBaseMessageConverter 11 | { 12 | GENERATED_BODY() 13 | 14 | public: 15 | UStdMsgsMultiArrayDimensionConverter(); 16 | virtual bool ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr &BaseMsg); 17 | virtual bool ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message); 18 | 19 | static bool _bson_extract_child_multi_array_dimension(bson_t *b, FString key, ROSMessages::std_msgs::MultiArrayDimension *msg, bool LogOnErrors = true) 20 | { 21 | bool KeyFound = false; 22 | 23 | msg->label = GetFStringFromBSON(key + ".label", b, KeyFound, LogOnErrors); if (!KeyFound) return false; 24 | msg->size = GetInt32FromBSON(key + ".size", b, KeyFound, LogOnErrors); if (!KeyFound) return false; 25 | msg->stride = GetInt32FromBSON(key + ".stride", b, KeyFound, LogOnErrors); if (!KeyFound) return false; 26 | return true; 27 | } 28 | 29 | static void _bson_append_child_multi_array_dimension(bson_t *b, const char *key, const ROSMessages::std_msgs::MultiArrayDimension *msg) 30 | { 31 | bson_t child; 32 | BSON_APPEND_DOCUMENT_BEGIN(b, key, &child); 33 | _bson_append_multi_array_dimension(&child, msg); 34 | bson_append_document_end(b, &child); 35 | } 36 | 37 | 38 | static void _bson_append_multi_array_dimension(bson_t *b, const ROSMessages::std_msgs::MultiArrayDimension *msg) 39 | { 40 | BSON_APPEND_UTF8(b, "label", TCHAR_TO_UTF8(*msg->label)); 41 | BSON_APPEND_INT32(b, "size", msg->size); 42 | BSON_APPEND_INT32(b, "stride", msg->stride); 43 | } 44 | }; -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/geometry_msgs/GeometryMsgsQuaternionConverter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "CoreMinimal.h" 4 | #include "Conversion/Messages/BaseMessageConverter.h" 5 | #include "geometry_msgs/Quaternion.h" 6 | #include "GeometryMsgsQuaternionConverter.generated.h" 7 | 8 | 9 | UCLASS() 10 | class ROSINTEGRATION_API UGeometryMsgsQuaternionConverter: public UBaseMessageConverter 11 | { 12 | GENERATED_BODY() 13 | 14 | public: 15 | UGeometryMsgsQuaternionConverter(); 16 | virtual bool ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr &BaseMsg); 17 | virtual bool ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message); 18 | 19 | static bool _bson_extract_child_quaternion(bson_t *b, FString key, ROSMessages::geometry_msgs::Quaternion *msg, bool LogOnErrors = true) 20 | { 21 | bool KeyFound = false; 22 | 23 | msg->x = GetDoubleFromBSON(key + ".x", b, KeyFound, LogOnErrors); if (!KeyFound) return false; 24 | msg->y = GetDoubleFromBSON(key + ".y", b, KeyFound, LogOnErrors); if (!KeyFound) return false; 25 | msg->z = GetDoubleFromBSON(key + ".z", b, KeyFound, LogOnErrors); if (!KeyFound) return false; 26 | msg->w = GetDoubleFromBSON(key + ".w", b, KeyFound, LogOnErrors); if (!KeyFound) return false; 27 | return true; 28 | } 29 | 30 | static void _bson_append_child_quaternion(bson_t *b, const char *key, const ROSMessages::geometry_msgs::Quaternion *msg) 31 | { 32 | bson_t child; 33 | BSON_APPEND_DOCUMENT_BEGIN(b, key, &child); 34 | _bson_append_quaternion(&child, msg); 35 | bson_append_document_end(b, &child); 36 | } 37 | 38 | static void _bson_append_quaternion(bson_t *b, const ROSMessages::geometry_msgs::Quaternion *msg) 39 | { 40 | BSON_APPEND_DOUBLE(b, "x", msg->x); 41 | BSON_APPEND_DOUBLE(b, "y", msg->y); 42 | BSON_APPEND_DOUBLE(b, "z", msg->z); 43 | BSON_APPEND_DOUBLE(b, "w", msg->w); 44 | } 45 | }; -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/std_msgs/StdMsgsHeaderConverter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "CoreMinimal.h" 4 | #include "Conversion/Messages/BaseMessageConverter.h" 5 | #include "std_msgs/Header.h" 6 | #include "StdMsgsHeaderConverter.generated.h" 7 | 8 | 9 | UCLASS() 10 | class ROSINTEGRATION_API UStdMsgsHeaderConverter: public UBaseMessageConverter 11 | { 12 | GENERATED_BODY() 13 | 14 | public: 15 | UStdMsgsHeaderConverter(); 16 | virtual bool ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr &BaseMsg); 17 | virtual bool ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message); 18 | 19 | static bool _bson_extract_child_header(bson_t *b, FString key, ROSMessages::std_msgs::Header *msg, bool LogOnErrors = true) 20 | { 21 | bool KeyFound = false; 22 | 23 | msg->seq = 0; 24 | if (ROS_VERSION == 1) 25 | { 26 | msg->seq = GetInt32FromBSON(key + ".seq", b, KeyFound, LogOnErrors); if (!KeyFound) return false; 27 | } 28 | 29 | if (!_bson_extract_child_ros_time(b, key + ".stamp", &msg->time, LogOnErrors)) return false; 30 | msg->frame_id = GetFStringFromBSON(key + ".frame_id", b, KeyFound, LogOnErrors); if (!KeyFound) return false; 31 | 32 | return true; 33 | } 34 | 35 | static void _bson_append_child_header(bson_t* b, const char* key, const ROSMessages::std_msgs::Header* msg) 36 | { 37 | bson_t child; 38 | BSON_APPEND_DOCUMENT_BEGIN(b, key, &child); 39 | _bson_append_header(&child, msg); 40 | bson_append_document_end(b, &child); 41 | } 42 | 43 | static void _bson_append_header(bson_t *b, const ROSMessages::std_msgs::Header *msg) 44 | { 45 | if (ROS_VERSION == 1) 46 | BSON_APPEND_INT32(b, "seq", msg->seq); 47 | 48 | _bson_append_child_ros_time(b, "stamp", &msg->time); 49 | 50 | BSON_APPEND_UTF8(b, "frame_id", TCHAR_TO_UTF8(*msg->frame_id)); 51 | } 52 | }; 53 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/sensor_msgs/SensorMsgsCompressedImageConverter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "CoreMinimal.h" 4 | #include "Conversion/Messages/BaseMessageConverter.h" 5 | #include "Conversion/Messages/std_msgs/StdMsgsHeaderConverter.h" 6 | #include "sensor_msgs/CompressedImage.h" 7 | #include "SensorMsgsCompressedImageConverter.generated.h" 8 | 9 | 10 | UCLASS() 11 | class ROSINTEGRATION_API USensorMsgsCompressedImageConverter : public UBaseMessageConverter 12 | { 13 | GENERATED_BODY() 14 | 15 | public: 16 | USensorMsgsCompressedImageConverter(); 17 | virtual bool ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr &BaseMsg); 18 | virtual bool ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message); 19 | 20 | static bool _bson_extract_child_image(bson_t *b, FString key, ROSMessages::sensor_msgs::CompressedImage *msg) 21 | { 22 | bool KeyFound = false; 23 | 24 | if (!UStdMsgsHeaderConverter::_bson_extract_child_header(b, key + ".header", &msg->header)) return false; 25 | msg->format = GetFStringFromBSON(key + ".format", b, KeyFound); if (!KeyFound) return false; 26 | msg->data = GetBinaryFromBSON(key + ".data", b, KeyFound); if (!KeyFound) return false; 27 | 28 | return KeyFound; 29 | } 30 | 31 | static void _bson_append_child_image(bson_t *b, const char *key, const ROSMessages::sensor_msgs::CompressedImage *msg) 32 | { 33 | bson_t child; 34 | BSON_APPEND_DOCUMENT_BEGIN(b, key, &child); 35 | _bson_append_image(&child, msg); 36 | bson_append_document_end(b, &child); 37 | } 38 | 39 | static void _bson_append_image(bson_t *b, const ROSMessages::sensor_msgs::CompressedImage *msg) 40 | { 41 | UStdMsgsHeaderConverter::_bson_append_child_header(b, "header", &msg->header); 42 | BSON_APPEND_UTF8(b, "format", TCHAR_TO_UTF8(*msg->format)); 43 | BSON_APPEND_BINARY(b, "data", BSON_SUBTYPE_BINARY, msg->data, msg->data_size); 44 | } 45 | }; -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/std_msgs/StdMsgsUInt8MultiArrayConverter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "CoreMinimal.h" 4 | #include "Conversion/Messages/BaseMessageConverter.h" 5 | #include "std_msgs/UInt8MultiArray.h" 6 | #include "Conversion/Messages/std_msgs/StdMsgsMultiArrayLayoutConverter.h" 7 | #include "StdMsgsUInt8MultiArrayConverter.generated.h" 8 | 9 | 10 | UCLASS() 11 | class ROSINTEGRATION_API UStdMsgsUInt8MultiArrayConverter : public UBaseMessageConverter 12 | { 13 | GENERATED_BODY() 14 | 15 | public: 16 | UStdMsgsUInt8MultiArrayConverter(); 17 | virtual bool ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr &BaseMsg); 18 | virtual bool ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message); 19 | 20 | static bool _bson_extract_child_uint8_multi_array(bson_t *b, FString key, ROSMessages::std_msgs::UInt8MultiArray *msg, bool LogOnErrors = true) 21 | { 22 | bool KeyFound = false; 23 | 24 | KeyFound = UStdMsgsMultiArrayLayoutConverter::_bson_extract_child_multi_array_layout(b, key + ".layout", &msg->layout, LogOnErrors); if (!KeyFound) return false; 25 | msg->data = rosbridge2cpp::Helper::get_binary_by_key(TCHAR_TO_UTF8(*(key + ".data")), *b, msg->layout.dim[0].size, KeyFound); 26 | 27 | return true; 28 | } 29 | 30 | static void _bson_append_child_uint8_multi_array(bson_t *b, const char *key, const ROSMessages::std_msgs::UInt8MultiArray *fma) 31 | { 32 | bson_t layout; 33 | BSON_APPEND_DOCUMENT_BEGIN(b, key, &layout); 34 | _bson_append_uint8_multi_array(&layout, fma); 35 | bson_append_document_end(b, &layout); 36 | } 37 | 38 | static void _bson_append_uint8_multi_array(bson_t *b, const ROSMessages::std_msgs::UInt8MultiArray *msg) 39 | { 40 | UStdMsgsMultiArrayLayoutConverter::_bson_append_child_multi_array_layout(b, "layout", &msg->layout); 41 | bson_append_binary(b, "data", -1, BSON_SUBTYPE_BINARY, msg->data, msg->layout.dim[0].size); 42 | } 43 | }; -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/actionlib_msgs/ActionlibMsgsGoalIDConverter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "CoreMinimal.h" 4 | #include "Conversion/Messages/BaseMessageConverter.h" 5 | #include "actionlib_msgs/GoalID.h" 6 | #include "ActionlibMsgsGoalIDConverter.generated.h" 7 | 8 | 9 | UCLASS() 10 | class ROSINTEGRATION_API UActionlibMsgsGoalIDConverter : public UBaseMessageConverter 11 | { 12 | GENERATED_BODY() 13 | 14 | public: 15 | UActionlibMsgsGoalIDConverter(); 16 | virtual bool ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr &BaseMsg); 17 | virtual bool ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message); 18 | 19 | static bool _bson_extract_child_goal_id(bson_t *b, FString key, ROSMessages::actionlib_msgs::GoalID *msg, bool LogOnErrors = true) 20 | { 21 | bool KeyFound = false; 22 | int32 Sec = GetInt32FromBSON(key + ".stamp.secs", b, KeyFound, LogOnErrors); if (!KeyFound) return false; 23 | int32 NSec = GetInt32FromBSON(key + ".stamp.nsecs", b, KeyFound, LogOnErrors); if (!KeyFound) return false; 24 | msg->id = GetFStringFromBSON(key + ".id", b, KeyFound, LogOnErrors); if (!KeyFound) return false; 25 | msg->stamp = FROSTime(Sec, NSec); 26 | 27 | return true; 28 | } 29 | 30 | static void _bson_append_child_goal_id(bson_t *b, const char *key, const ROSMessages::actionlib_msgs::GoalID *msg) 31 | { 32 | bson_t child; 33 | BSON_APPEND_DOCUMENT_BEGIN(b, key, &child); 34 | _bson_append_goal_id(&child, msg); 35 | bson_append_document_end(b, &child); 36 | } 37 | 38 | static void _bson_append_goal_id(bson_t *b, const ROSMessages::actionlib_msgs::GoalID *msg) 39 | { 40 | bson_t stamp; 41 | BSON_APPEND_DOCUMENT_BEGIN(b, "stamp", &stamp); 42 | BSON_APPEND_INT32(&stamp, "secs", msg->stamp._Sec); 43 | BSON_APPEND_INT32(&stamp, "nsecs", msg->stamp._NSec); 44 | bson_append_document_end(b, &stamp); 45 | BSON_APPEND_UTF8(b, "id", TCHAR_TO_UTF8(*msg->id)); 46 | } 47 | }; 48 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/geometry_msgs/GeometryMsgsTransformConverter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "CoreMinimal.h" 4 | #include "Conversion/Messages/BaseMessageConverter.h" 5 | #include "geometry_msgs/Transform.h" 6 | #include "Conversion/Messages/geometry_msgs/GeometryMsgsVector3Converter.h" 7 | #include "Conversion/Messages/geometry_msgs/GeometryMsgsQuaternionConverter.h" 8 | #include "GeometryMsgsTransformConverter.generated.h" 9 | 10 | 11 | UCLASS() 12 | class ROSINTEGRATION_API UGeometryMsgsTransformConverter: public UBaseMessageConverter 13 | { 14 | GENERATED_BODY() 15 | 16 | public: 17 | UGeometryMsgsTransformConverter(); 18 | virtual bool ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr &BaseMsg); 19 | virtual bool ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message); 20 | 21 | static bool _bson_extract_child_transform(bson_t *b, FString key, ROSMessages::geometry_msgs::Transform *msg, bool LogOnErrors = true) 22 | { 23 | if (!UGeometryMsgsVector3Converter::_bson_extract_child_vector3(b, key + ".translation", &msg->translation)) return false; 24 | if (!UGeometryMsgsQuaternionConverter::_bson_extract_child_quaternion(b, key + ".rotation", &msg->rotation)) return false; 25 | return true; 26 | } 27 | 28 | static void _bson_append_child_transform(bson_t *b, const char *key, const ROSMessages::geometry_msgs::Transform *msg) 29 | { 30 | bson_t child; 31 | BSON_APPEND_DOCUMENT_BEGIN(b, key, &child); 32 | _bson_append_transform(&child, msg); 33 | bson_append_document_end(b, &child); 34 | } 35 | 36 | static void _bson_append_transform(bson_t *b, const ROSMessages::geometry_msgs::Transform *msg) 37 | { 38 | UGeometryMsgsVector3Converter::_bson_append_child_vector3(b, "translation", &msg->translation); 39 | UGeometryMsgsQuaternionConverter::_bson_append_child_quaternion(b, "rotation", &msg->rotation); 40 | } 41 | }; -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/rosbridge2cpp/messages/rosbridge_subscribe_msg.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include "messages/rosbridge_msg.h" 6 | 7 | class ROSBridgeSubscribeMsg : public ROSBridgeMsg { 8 | public: 9 | ROSBridgeSubscribeMsg() : ROSBridgeMsg() {} 10 | 11 | ROSBridgeSubscribeMsg(bool init_opcode) : ROSBridgeMsg() 12 | { 13 | if (init_opcode) 14 | op_ = ROSBridgeMsg::SUBSCRIBE; 15 | } 16 | 17 | virtual ~ROSBridgeSubscribeMsg() = default; 18 | 19 | 20 | // Subscribe messages will never be received from the client 21 | // So we don't need to fill this instance from JSON or other wire-level representations 22 | bool FromJSON(const rapidjson::Document &data) = delete; 23 | bool FromBSON(bson_t &bson) = delete; 24 | 25 | rapidjson::Document ToJSON(rapidjson::Document::AllocatorType& alloc) 26 | { 27 | rapidjson::Document d(rapidjson::kObjectType); 28 | d.AddMember("op", getOpCodeString(), alloc); 29 | 30 | add_if_value_changed(d, alloc, "id", id_); 31 | add_if_value_changed(d, alloc, "topic", topic_); 32 | add_if_value_changed(d, alloc, "type", type_); 33 | add_if_value_changed(d, alloc, "queue_length", queue_length_); 34 | add_if_value_changed(d, alloc, "throttle_rate", throttle_rate_); 35 | add_if_value_changed(d, alloc, "compression", compression_); 36 | 37 | return d; 38 | } 39 | 40 | void ToBSON(bson_t &bson) 41 | { 42 | BSON_APPEND_UTF8(&bson, "op", getOpCodeString().c_str()); 43 | add_if_value_changed(bson, "id", id_); 44 | 45 | add_if_value_changed(bson, "topic", topic_); 46 | add_if_value_changed(bson, "type", type_); 47 | add_if_value_changed(bson, "queue_length", queue_length_); 48 | add_if_value_changed(bson, "throttle_rate", throttle_rate_); 49 | add_if_value_changed(bson, "compression", compression_); 50 | } 51 | 52 | std::string topic_; 53 | std::string type_; 54 | int queue_length_ = -1; 55 | int throttle_rate_ = -1; 56 | std::string compression_; 57 | private: 58 | /* data */ 59 | }; 60 | -------------------------------------------------------------------------------- /ThirdParty/bson/include/mac/bson-memory.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | 18 | #ifndef BSON_MEMORY_H 19 | #define BSON_MEMORY_H 20 | 21 | 22 | #if !defined(BSON_INSIDE) && !defined(BSON_COMPILATION) 23 | #error "Only can be included directly." 24 | #endif 25 | 26 | 27 | #include "bson-macros.h" 28 | #include "bson-types.h" 29 | 30 | 31 | BSON_BEGIN_DECLS 32 | 33 | 34 | typedef void *(*bson_realloc_func) (void *mem, size_t num_bytes, void *ctx); 35 | 36 | 37 | typedef struct _bson_mem_vtable_t { 38 | void *(*malloc) (size_t num_bytes); 39 | void *(*calloc) (size_t n_members, size_t num_bytes); 40 | void *(*realloc) (void *mem, size_t num_bytes); 41 | void (*free) (void *mem); 42 | void *padding[4]; 43 | } bson_mem_vtable_t; 44 | 45 | 46 | BSON_EXPORT (void) 47 | bson_mem_set_vtable (const bson_mem_vtable_t *vtable); 48 | BSON_EXPORT (void) 49 | bson_mem_restore_vtable (void); 50 | BSON_EXPORT (void *) 51 | bson_malloc (size_t num_bytes); 52 | BSON_EXPORT (void *) 53 | bson_malloc0 (size_t num_bytes); 54 | BSON_EXPORT (void *) 55 | bson_realloc (void *mem, size_t num_bytes); 56 | BSON_EXPORT (void *) 57 | bson_realloc_ctx (void *mem, size_t num_bytes, void *ctx); 58 | BSON_EXPORT (void) 59 | bson_free (void *mem); 60 | BSON_EXPORT (void) 61 | bson_zero_free (void *mem, size_t size); 62 | 63 | 64 | BSON_END_DECLS 65 | 66 | 67 | #endif /* BSON_MEMORY_H */ 68 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/geometry_msgs/GeometryMsgsPoseWithCovarianceConverter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "CoreMinimal.h" 4 | #include "Conversion/Messages/BaseMessageConverter.h" 5 | #include "Conversion/Messages/geometry_msgs/GeometryMsgsPoseConverter.h" 6 | #include "geometry_msgs/PoseWithCovariance.h" 7 | #include "GeometryMsgsPoseWithCovarianceConverter.generated.h" 8 | 9 | 10 | UCLASS() 11 | class ROSINTEGRATION_API UGeometryMsgsPoseWithCovarianceConverter : public UBaseMessageConverter 12 | { 13 | GENERATED_BODY() 14 | 15 | public: 16 | UGeometryMsgsPoseWithCovarianceConverter(); 17 | virtual bool ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr &BaseMsg); 18 | virtual bool ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message); 19 | 20 | static bool _bson_extract_child_pose_with_covariance(bson_t *b, FString key, ROSMessages::geometry_msgs::PoseWithCovariance *p, bool LogOnErrors = true) 21 | { 22 | bool KeyFound = false; 23 | 24 | if (!UGeometryMsgsPoseConverter::_bson_extract_child_pose(b, key + ".pose", &p->pose, LogOnErrors)) 25 | return false; 26 | 27 | p->covariance = GetDoubleTArrayFromBSON(key + ".covariance", b, KeyFound, LogOnErrors); 28 | if (!KeyFound || p->covariance.Num() != 36) // ROS requires there to be 36 elements 29 | return false; 30 | 31 | return true; 32 | } 33 | 34 | static void _bson_append_child_pose_with_covariance(bson_t *b, const char *key, const ROSMessages::geometry_msgs::PoseWithCovariance *msg) 35 | { 36 | bson_t child; 37 | BSON_APPEND_DOCUMENT_BEGIN(b, key, &child); 38 | _bson_append_pose_with_covariance(&child, msg); 39 | bson_append_document_end(b, &child); 40 | } 41 | 42 | static void _bson_append_pose_with_covariance(bson_t *b, const ROSMessages::geometry_msgs::PoseWithCovariance *msg) 43 | { 44 | UGeometryMsgsPoseConverter::_bson_append_child_pose(b, "pose", &msg->pose); 45 | _bson_append_double_tarray(b, "covariance", msg->covariance); 46 | } 47 | }; -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Services/std_srvs/StdSrvsTriggerResponseConverter.cpp: -------------------------------------------------------------------------------- 1 | #include "Conversion/Services/std_srvs/StdSrvsTriggerResponseConverter.h" 2 | 3 | #include "std_srvs/TriggerResponse.h" 4 | #include 5 | 6 | 7 | UStdSrvsTriggerResponseConverter::UStdSrvsTriggerResponseConverter() 8 | { 9 | _ServiceType = "std_srvs/Trigger"; 10 | } 11 | 12 | bool UStdSrvsTriggerResponseConverter::ConvertIncomingResponse(const ROSBridgeServiceResponseMsg &res, TSharedRef> Response) 13 | { 14 | bool key_found = false; 15 | *Response = MakeShareable(new std_srvs::FTriggerResponse); 16 | auto ServiceResponse = StaticCastSharedPtr(*Response); 17 | 18 | ServiceResponse->_Result = res.result_; 19 | 20 | ServiceResponse->_success = rosbridge2cpp::Helper::get_bool_by_key("values.success", *res.full_msg_bson_, key_found); 21 | if (!key_found) { 22 | UE_LOG(LogTemp, Error, TEXT("Key values.success not present in data")); 23 | return false; 24 | } 25 | 26 | std::string messageStd = rosbridge2cpp::Helper::get_utf8_by_key("values.message", *res.full_msg_bson_, key_found); 27 | ServiceResponse->_message = messageStd.c_str(); 28 | if (!key_found) { 29 | UE_LOG(LogTemp, Error, TEXT("Key values.message not present in data")); 30 | return false; 31 | } 32 | 33 | return true; 34 | } 35 | 36 | bool UStdSrvsTriggerResponseConverter::ConvertOutgoingResponse(TSharedPtr Response, ROSBridgeServiceResponseMsg &res) 37 | { 38 | auto ServiceResponse = StaticCastSharedPtr(Response); 39 | 40 | res.result_ = ServiceResponse->_Result; 41 | BSON_APPEND_BOOL(res.values_bson_, "success", ServiceResponse->_success); 42 | BSON_APPEND_UTF8(res.values_bson_, "message", TCHAR_TO_UTF8(*ServiceResponse->_message)); 43 | return true; 44 | } 45 | 46 | TSharedPtr UStdSrvsTriggerResponseConverter::AllocateConcreteResponse() 47 | { 48 | return MakeShareable(new std_srvs::FTriggerResponse); 49 | } -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/geometry_msgs/GeometryMsgsTwistWithCovarianceConverter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "CoreMinimal.h" 4 | #include "Conversion/Messages/BaseMessageConverter.h" 5 | #include "Conversion/Messages/geometry_msgs/GeometryMsgsTwistConverter.h" 6 | #include "geometry_msgs/TwistWithCovariance.h" 7 | #include "GeometryMsgsTwistWithCovarianceConverter.generated.h" 8 | 9 | 10 | UCLASS() 11 | class ROSINTEGRATION_API UGeometryMsgsTwistWithCovarianceConverter : public UBaseMessageConverter 12 | { 13 | GENERATED_BODY() 14 | 15 | public: 16 | UGeometryMsgsTwistWithCovarianceConverter(); 17 | virtual bool ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr &BaseMsg); 18 | virtual bool ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message); 19 | 20 | static bool _bson_extract_child_twist_with_covariance(bson_t *b, FString key, ROSMessages::geometry_msgs::TwistWithCovariance *msg, bool LogOnErrors = true) 21 | { 22 | bool KeyFound = false; 23 | 24 | if (!UGeometryMsgsTwistConverter::_bson_extract_child_twist(b, key + ".twist", &msg->twist, LogOnErrors)) 25 | return false; 26 | 27 | msg->covariance = GetDoubleTArrayFromBSON(key + ".covariance", b, KeyFound, LogOnErrors); 28 | if (!KeyFound || msg->covariance.Num() != 36) // ROS requires there to be 36 elements 29 | return false; 30 | 31 | return true; 32 | } 33 | 34 | static void _bson_append_child_twist_with_covariance(bson_t *b, const char *key, const ROSMessages::geometry_msgs::TwistWithCovariance *msg) 35 | { 36 | bson_t child; 37 | BSON_APPEND_DOCUMENT_BEGIN(b, key, &child); 38 | _bson_append_twist_with_covariance(&child, msg); 39 | bson_append_document_end(b, &child); 40 | } 41 | 42 | static void _bson_append_twist_with_covariance(bson_t *b, const ROSMessages::geometry_msgs::TwistWithCovariance *msg) 43 | { 44 | UGeometryMsgsTwistConverter::_bson_append_child_twist(b, "twist", &msg->twist); 45 | _bson_append_double_tarray(b, "covariance", msg->covariance); 46 | } 47 | }; -------------------------------------------------------------------------------- /ThirdParty/bson/include/mac/bson-writer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | 18 | #ifndef BSON_WRITER_H 19 | #define BSON_WRITER_H 20 | 21 | 22 | #include "bson.h" 23 | 24 | 25 | BSON_BEGIN_DECLS 26 | 27 | 28 | /** 29 | * bson_writer_t: 30 | * 31 | * The bson_writer_t structure is a helper for writing a series of BSON 32 | * documents to a single malloc() buffer. You can provide a realloc() style 33 | * function to grow the buffer as you go. 34 | * 35 | * This is useful if you want to build a series of BSON documents right into 36 | * the target buffer for an outgoing packet. The offset parameter allows you to 37 | * start at an offset of the target buffer. 38 | */ 39 | typedef struct _bson_writer_t bson_writer_t; 40 | 41 | 42 | BSON_EXPORT (bson_writer_t *) 43 | bson_writer_new (uint8_t **buf, 44 | size_t *buflen, 45 | size_t offset, 46 | bson_realloc_func realloc_func, 47 | void *realloc_func_ctx); 48 | BSON_EXPORT (void) 49 | bson_writer_destroy (bson_writer_t *writer); 50 | BSON_EXPORT (size_t) 51 | bson_writer_get_length (bson_writer_t *writer); 52 | BSON_EXPORT (bool) 53 | bson_writer_begin (bson_writer_t *writer, bson_t **bson); 54 | BSON_EXPORT (void) 55 | bson_writer_end (bson_writer_t *writer); 56 | BSON_EXPORT (void) 57 | bson_writer_rollback (bson_writer_t *writer); 58 | 59 | 60 | BSON_END_DECLS 61 | 62 | 63 | #endif /* BSON_WRITER_H */ 64 | -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/nav_msgs/NavMsgsOccupancyGridConverter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "CoreMinimal.h" 4 | #include "Conversion/Messages/BaseMessageConverter.h" 5 | #include "Conversion/Messages/std_msgs/StdMsgsHeaderConverter.h" 6 | #include "Conversion/Messages/nav_msgs/NavMsgsMapMetaDataConverter.h" 7 | #include "nav_msgs/OccupancyGrid.h" 8 | #include "NavMsgsOccupancyGridConverter.generated.h" 9 | 10 | 11 | UCLASS() 12 | class ROSINTEGRATION_API UNavMsgsOccupancyGridConverter : public UBaseMessageConverter 13 | { 14 | GENERATED_BODY() 15 | 16 | public: 17 | UNavMsgsOccupancyGridConverter(); 18 | virtual bool ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr &BaseMsg); 19 | virtual bool ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message); 20 | 21 | static bool _bson_extract_child_occupancy_grid(bson_t *b, FString key, ROSMessages::nav_msgs::OccupancyGrid *msg, bool LogOnErrors = true) 22 | { 23 | bool KeyFound = false; 24 | 25 | if (!UStdMsgsHeaderConverter::_bson_extract_child_header(b, key + ".header", &msg->header)) return false; 26 | if (!UNavMsgsMapMetaDataConverter::_bson_extract_child_map_meta_data(b, key + ".info", &msg->info)) return false; 27 | msg->data = GetInt32TArrayFromBSON(key + ".data", b, KeyFound); if (!KeyFound) return false; 28 | 29 | return true; 30 | } 31 | 32 | static void _bson_append_child_occupancy_grid(bson_t *b, const char *key, const ROSMessages::nav_msgs::OccupancyGrid *msg) 33 | { 34 | bson_t child; 35 | BSON_APPEND_DOCUMENT_BEGIN(b, key, &child); 36 | _bson_append_occupancy_grid(&child, msg); 37 | bson_append_document_end(b, &child); 38 | } 39 | 40 | static void _bson_append_occupancy_grid(bson_t *b, const ROSMessages::nav_msgs::OccupancyGrid *msg) 41 | { 42 | UStdMsgsHeaderConverter::_bson_append_child_header(b, "header", &msg->header); 43 | UNavMsgsMapMetaDataConverter::_bson_append_child_map_meta_data(b, "info", &msg->info); 44 | _bson_append_int32_tarray(b, "data", msg->data); 45 | } 46 | }; -------------------------------------------------------------------------------- /Source/ROSIntegration/Private/Conversion/Messages/actionlib_msgs/ActionlibMsgsGoalStatusConverter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "CoreMinimal.h" 4 | #include "Conversion/Messages/BaseMessageConverter.h" 5 | #include "Conversion/Messages/actionlib_msgs/ActionlibMsgsGoalIDConverter.h" 6 | #include "actionlib_msgs/GoalStatus.h" 7 | #include "ActionlibMsgsGoalStatusConverter.generated.h" 8 | 9 | 10 | UCLASS() 11 | class ROSINTEGRATION_API UActionlibMsgsGoalStatusConverter : public UBaseMessageConverter 12 | { 13 | GENERATED_BODY() 14 | 15 | public: 16 | UActionlibMsgsGoalStatusConverter(); 17 | virtual bool ConvertIncomingMessage(const ROSBridgePublishMsg* message, TSharedPtr &BaseMsg); 18 | virtual bool ConvertOutgoingMessage(TSharedPtr BaseMsg, bson_t** message); 19 | 20 | static bool _bson_extract_child_goal_status(bson_t *b, FString key, ROSMessages::actionlib_msgs::GoalStatus *msg, bool LogOnErrors = true) 21 | { 22 | bool KeyFound = false; 23 | if (!UActionlibMsgsGoalIDConverter::_bson_extract_child_goal_id(b, key + ".goal_id", &msg->goal_id, LogOnErrors)) return false; 24 | msg->status = static_cast( GetInt32FromBSON(key + ".status", b, KeyFound, LogOnErrors) ); if (!KeyFound) return false; // TODO: there is no GetUInt8FromBSON, do we need to implement that? 25 | msg->text = GetFStringFromBSON(key + ".text", b, KeyFound, LogOnErrors); if (!KeyFound) return false; 26 | 27 | return true; 28 | } 29 | 30 | static void _bson_append_child_goal_status(bson_t *b, const char *key, const ROSMessages::actionlib_msgs::GoalStatus *msg) 31 | { 32 | bson_t child; 33 | BSON_APPEND_DOCUMENT_BEGIN(b, key, &child); 34 | _bson_append_goal_status(&child, msg); 35 | bson_append_document_end(b, &child); 36 | } 37 | 38 | static void _bson_append_goal_status(bson_t *b, const ROSMessages::actionlib_msgs::GoalStatus *msg) 39 | { 40 | UActionlibMsgsGoalIDConverter::_bson_append_child_goal_id(b, "goal_id", &msg->goal_id); 41 | BSON_APPEND_INT32(b, "status", msg->status); 42 | BSON_APPEND_UTF8(b, "text", TCHAR_TO_UTF8(*msg->text)); 43 | } 44 | }; 45 | --------------------------------------------------------------------------------