From 9283d4d4f70957bbaa8e23f47791881bea888059 Mon Sep 17 00:00:00 2001 From: veronika Date: Sat, 18 Oct 2025 13:16:31 -0400 Subject: [PATCH 1/3] Updated ros_lib library --- .../actionlib_tutorials/AveragingAction.h | 56 - .../AveragingActionFeedback.h | 56 - .../actionlib_tutorials/AveragingActionGoal.h | 56 - .../AveragingActionResult.h | 56 - .../actionlib_tutorials/AveragingFeedback.h | 134 -- .../actionlib_tutorials/AveragingGoal.h | 62 - .../actionlib_tutorials/AveragingResult.h | 86 -- .../actionlib_tutorials/FibonacciAction.h | 56 - .../FibonacciActionFeedback.h | 56 - .../actionlib_tutorials/FibonacciActionGoal.h | 56 - .../FibonacciActionResult.h | 56 - .../actionlib_tutorials/FibonacciFeedback.h | 82 -- .../actionlib_tutorials/FibonacciGoal.h | 62 - .../actionlib_tutorials/FibonacciResult.h | 82 -- .../ros_lib/apriltag_ros/AnalyzeSingleImage.h | 116 ++ .../ros_lib/apriltag_ros/AprilTagDetection.h | 113 ++ .../apriltag_ros/AprilTagDetectionArray.h | 70 + .../lib/ros_lib/auv_msgs/ThrusterForces.h | 82 +- .../ros_lib/auv_msgs/ThrusterMicroseconds.h | 18 +- .../lib/ros_lib/auv_msgs/UnityState.h | 250 ++-- .../base_local_planner/Position2DInt.h | 102 ++ .../lib/ros_lib/control_toolbox/SetPidGains.h | 108 -- .../controller_manager_msgs/ControllerState.h | 115 -- .../ControllerStatistics.h | 231 ---- .../ControllersStatistics.h | 70 - .../HardwareInterfaceResources.h | 92 -- .../ListControllerTypes.h | 144 -- .../controller_manager_msgs/ListControllers.h | 96 -- .../controller_manager_msgs/LoadController.h | 105 -- .../ReloadControllerLibraries.h | 106 -- .../SwitchController.h | 211 --- .../UnloadController.h | 105 -- .../lib/ros_lib/costmap_2d/VoxelGrid.h | 128 ++ .../ros_lib/find_object_2d/DetectionInfo.h | 222 ++++ .../ros_lib/find_object_2d/ObjectsStamped.h | 50 + .../lib/ros_lib/gazebo_msgs/ApplyBodyWrench.h | 4 +- .../ros_lib/gazebo_msgs/ApplyJointEffort.h | 2 +- .../lib/ros_lib/gazebo_msgs/GetModelState.h | 2 +- .../ros_lib/gazebo_msgs/SetJointTrajectory.h | 2 +- .../lib/ros_lib/geographic_msgs/BoundingBox.h | 49 + .../lib/ros_lib/geographic_msgs/GeoPath.h | 70 + .../lib/ros_lib/geographic_msgs/GeoPoint.h | 53 + .../ros_lib/geographic_msgs/GeoPointStamped.h | 50 + .../lib/ros_lib/geographic_msgs/GeoPose.h | 50 + .../ros_lib/geographic_msgs/GeoPoseStamped.h | 50 + .../ros_lib/geographic_msgs/GeographicMap.h | 134 ++ .../geographic_msgs/GeographicMapChanges.h | 76 ++ .../lib/ros_lib/geographic_msgs/GetGeoPath.h | 143 ++ .../geographic_msgs/GetGeographicMap.h | 134 ++ .../ros_lib/geographic_msgs/GetRoutePlan.h | 127 ++ .../lib/ros_lib/geographic_msgs/KeyValue.h | 72 + .../lib/ros_lib/geographic_msgs/MapFeature.h | 95 ++ .../ros_lib/geographic_msgs/RouteNetwork.h | 134 ++ .../lib/ros_lib/geographic_msgs/RoutePath.h | 101 ++ .../ros_lib/geographic_msgs/RouteSegment.h | 80 ++ .../geographic_msgs/UpdateGeographicMap.h | 111 ++ .../lib/ros_lib/geographic_msgs/WayPoint.h | 76 ++ .../lib/ros_lib/grid_map_msgs/GetGridMap.h | 150 +++ .../ros_lib/grid_map_msgs/GetGridMapInfo.h | 76 ++ .../lib/ros_lib/grid_map_msgs/GridMap.h | 162 +++ .../lib/ros_lib/grid_map_msgs/GridMapInfo.h | 65 + .../lib/ros_lib/grid_map_msgs/ProcessFile.h | 122 ++ .../lib/ros_lib/grid_map_msgs/SetGridMap.h | 76 ++ .../ros_lib/hector_mapping/HectorDebugInfo.h | 64 + .../ros_lib/hector_mapping/HectorIterData.h | 66 + .../lib/ros_lib/hector_mapping/ResetMapping.h | 76 ++ .../ros_lib/laser_assembler/AssembleScans.h | 123 -- .../ros_lib/laser_assembler/AssembleScans2.h | 123 -- .../lib/ros_lib/mavros_msgs/ADSBVehicle.h | 268 ++++ .../lib/ros_lib/mavros_msgs/ActuatorControl.h | 82 ++ .../lib/ros_lib/mavros_msgs/Altitude.h | 188 +++ .../lib/ros_lib/mavros_msgs/AttitudeTarget.h | 92 ++ .../lib/ros_lib/mavros_msgs/BatteryStatus.h | 116 ++ .../lib/ros_lib/mavros_msgs/CamIMUStamp.h | 86 ++ .../ros_lib/mavros_msgs/CameraImageCaptured.h | 139 ++ .../lib/ros_lib/mavros_msgs/CellularStatus.h | 93 ++ .../lib/ros_lib/mavros_msgs/CommandAck.h | 131 ++ .../lib/ros_lib/mavros_msgs/CommandBool.h | 113 ++ .../lib/ros_lib/mavros_msgs/CommandCode.h | 173 +++ .../lib/ros_lib/mavros_msgs/CommandHome.h | 209 +++ .../lib/ros_lib/mavros_msgs/CommandInt.h | 304 +++++ .../lib/ros_lib/mavros_msgs/CommandLong.h | 297 +++++ .../lib/ros_lib/mavros_msgs/CommandTOL.h | 215 +++ .../mavros_msgs/CommandTriggerControl.h | 149 +++ .../mavros_msgs/CommandTriggerInterval.h | 143 ++ .../mavros_msgs/CommandVtolTransition.h | 110 ++ .../mavros_msgs/CompanionProcessStatus.h | 69 + .../lib/ros_lib/mavros_msgs/DebugValue.h | 213 +++ .../lib/ros_lib/mavros_msgs/ESCInfo.h | 100 ++ .../lib/ros_lib/mavros_msgs/ESCInfoItem.h | 90 ++ .../lib/ros_lib/mavros_msgs/ESCStatus.h | 70 + .../lib/ros_lib/mavros_msgs/ESCStatusItem.h | 116 ++ .../lib/ros_lib/mavros_msgs/ESCTelemetry.h | 70 + .../ros_lib/mavros_msgs/ESCTelemetryItem.h | 173 +++ .../lib/ros_lib/mavros_msgs/EstimatorStatus.h | 260 ++++ .../lib/ros_lib/mavros_msgs/ExtendedState.h | 68 + .../lib/ros_lib/mavros_msgs/FileChecksum.h | 142 ++ .../lib/ros_lib/mavros_msgs/FileClose.h | 129 ++ .../lib/ros_lib/mavros_msgs/FileEntry.h | 85 ++ .../lib/ros_lib/mavros_msgs/FileList.h | 155 +++ .../lib/ros_lib/mavros_msgs/FileMakeDir.h | 129 ++ .../lib/ros_lib/mavros_msgs/FileOpen.h | 152 +++ .../lib/ros_lib/mavros_msgs/FileRead.h | 198 +++ .../lib/ros_lib/mavros_msgs/FileRemove.h | 129 ++ .../lib/ros_lib/mavros_msgs/FileRemoveDir.h | 129 ++ .../lib/ros_lib/mavros_msgs/FileRename.h | 146 +++ .../lib/ros_lib/mavros_msgs/FileTruncate.h | 150 +++ .../lib/ros_lib/mavros_msgs/FileWrite.h | 177 +++ .../lib/ros_lib/mavros_msgs/GPSINPUT.h | 378 ++++++ .../lib/ros_lib/mavros_msgs/GPSRAW.h | 291 +++++ .../lib/ros_lib/mavros_msgs/GPSRTK.h | 214 +++ .../mavros_msgs/GlobalPositionTarget.h | 168 +++ .../ros_lib/mavros_msgs/HilActuatorControls.h | 99 ++ .../lib/ros_lib/mavros_msgs/HilControls.h | 250 ++++ .../lib/ros_lib/mavros_msgs/HilGPS.h | 160 +++ .../lib/ros_lib/mavros_msgs/HilSensor.h | 169 +++ .../ros_lib/mavros_msgs/HilStateQuaternion.h | 120 ++ .../lib/ros_lib/mavros_msgs/HomePosition.h | 68 + .../lib/ros_lib/mavros_msgs/LandingTarget.h | 165 +++ .../lib/ros_lib/mavros_msgs/LogData.h | 93 ++ .../lib/ros_lib/mavros_msgs/LogEntry.h | 108 ++ .../lib/ros_lib/mavros_msgs/LogRequestData.h | 123 ++ .../lib/ros_lib/mavros_msgs/LogRequestEnd.h | 88 ++ .../lib/ros_lib/mavros_msgs/LogRequestList.h | 106 ++ .../mavros_msgs/MagnetometerReporter.h | 75 ++ .../lib/ros_lib/mavros_msgs/ManualControl.h | 149 +++ .../lib/ros_lib/mavros_msgs/Mavlink.h | 195 +++ .../lib/ros_lib/mavros_msgs/MessageInterval.h | 125 ++ .../lib/ros_lib/mavros_msgs/MountConfigure.h | 191 +++ .../lib/ros_lib/mavros_msgs/MountControl.h | 200 +++ .../ros_lib/mavros_msgs/NavControllerOutput.h | 213 +++ .../mavros_msgs/OnboardComputerStatus.h | 327 +++++ .../lib/ros_lib/mavros_msgs/OpticalFlowRad.h | 241 ++++ .../lib/ros_lib/mavros_msgs/OverrideRCIn.h | 52 + pio_workspace/lib/ros_lib/mavros_msgs/Param.h | 85 ++ .../lib/ros_lib/mavros_msgs/ParamGet.h | 111 ++ .../lib/ros_lib/mavros_msgs/ParamPull.h | 119 ++ .../lib/ros_lib/mavros_msgs/ParamPush.h | 101 ++ .../lib/ros_lib/mavros_msgs/ParamSet.h | 116 ++ .../lib/ros_lib/mavros_msgs/ParamValue.h | 75 ++ .../lib/ros_lib/mavros_msgs/PlayTuneV2.h | 64 + .../lib/ros_lib/mavros_msgs/PositionTarget.h | 141 ++ pio_workspace/lib/ros_lib/mavros_msgs/RCIn.h | 80 ++ pio_workspace/lib/ros_lib/mavros_msgs/RCOut.h | 73 ++ pio_workspace/lib/ros_lib/mavros_msgs/RTCM.h | 71 + .../lib/ros_lib/mavros_msgs/RTKBaseline.h | 225 ++++ .../lib/ros_lib/mavros_msgs/RadioStatus.h | 145 +++ .../lib/ros_lib/mavros_msgs/SetMavFrame.h | 117 ++ .../lib/ros_lib/mavros_msgs/SetMode.h | 123 ++ pio_workspace/lib/ros_lib/mavros_msgs/State.h | 202 +++ .../lib/ros_lib/mavros_msgs/StatusText.h | 76 ++ .../lib/ros_lib/mavros_msgs/StreamRate.h | 113 ++ .../lib/ros_lib/mavros_msgs/SysStatus.h | 193 +++ .../lib/ros_lib/mavros_msgs/TerrainReport.h | 129 ++ .../lib/ros_lib/mavros_msgs/Thrust.h | 68 + .../lib/ros_lib/mavros_msgs/TimesyncStatus.h | 153 +++ .../lib/ros_lib/mavros_msgs/Trajectory.h | 128 ++ .../lib/ros_lib/mavros_msgs/Tunnel.h | 89 ++ .../lib/ros_lib/mavros_msgs/VFR_HUD.h | 184 +++ .../lib/ros_lib/mavros_msgs/VehicleInfo.h | 267 ++++ .../lib/ros_lib/mavros_msgs/VehicleInfoGet.h | 148 +++ .../lib/ros_lib/mavros_msgs/Vibration.h | 77 ++ .../lib/ros_lib/mavros_msgs/Waypoint.h | 223 ++++ .../lib/ros_lib/mavros_msgs/WaypointClear.h | 88 ++ .../lib/ros_lib/mavros_msgs/WaypointList.h | 73 ++ .../lib/ros_lib/mavros_msgs/WaypointPull.h | 101 ++ .../lib/ros_lib/mavros_msgs/WaypointPush.h | 136 ++ .../lib/ros_lib/mavros_msgs/WaypointReached.h | 53 + .../ros_lib/mavros_msgs/WaypointSetCurrent.h | 97 ++ .../WheelOdomStamped.h} | 43 +- .../MoveBaseAction.h} | 26 +- .../MoveBaseActionFeedback.h} | 18 +- .../MoveBaseActionGoal.h} | 18 +- .../MoveBaseActionResult.h} | 18 +- .../ros_lib/move_base_msgs/MoveBaseFeedback.h | 44 + .../lib/ros_lib/move_base_msgs/MoveBaseGoal.h | 44 + .../MoveBaseResult.h} | 12 +- .../ros_lib/move_base_msgs/RecoveryStatus.h | 79 ++ pio_workspace/lib/ros_lib/nav_msgs/SetMap.h | 2 +- pio_workspace/lib/ros_lib/navfn/MakeNavPlan.h | 130 ++ pio_workspace/lib/ros_lib/navfn/SetCostmap.h | 115 ++ .../ros_lib/octomap_msgs/BoundingBoxQuery.h | 81 ++ .../lib/ros_lib/octomap_msgs/GetOctomap.h | 76 ++ .../lib/ros_lib/octomap_msgs/Octomap.h | 122 ++ .../ros_lib/octomap_msgs/OctomapWithPose.h | 56 + .../ros_lib/polled_camera/GetPolledImage.h | 202 --- .../ros_lib/realsense2_camera/DeviceInfo.h | 172 +++ .../ros_lib/realsense2_camera/Extrinsics.h | 60 + .../lib/ros_lib/realsense2_camera/IMUInfo.h | 79 ++ .../lib/ros_lib/realsense2_camera/Metadata.h | 61 + .../lib/ros_lib/robot_localization/FromLL.h | 82 ++ .../lib/ros_lib/robot_localization/GetState.h | 127 ++ .../lib/ros_lib/robot_localization/SetDatum.h | 76 ++ .../lib/ros_lib/robot_localization/SetPose.h | 76 ++ .../ros_lib/robot_localization/SetUTMZone.h | 87 ++ .../lib/ros_lib/robot_localization/ToLL.h | 82 ++ .../ToggleFilterProcessing.h | 106 ++ .../lib/ros_lib/roscpp_tutorials/TwoInts.h | 166 --- .../lib/ros_lib/rospy_tutorials/AddTwoInts.h | 166 --- .../lib/ros_lib/rospy_tutorials/BadTwoInts.h | 150 --- .../ros_lib/rospy_tutorials/HeaderString.h | 61 - .../lib/ros_lib/rtabmap_msgs/AddLink.h | 76 ++ .../lib/ros_lib/rtabmap_msgs/CameraModel.h | 50 + .../lib/ros_lib/rtabmap_msgs/CameraModels.h | 64 + .../ros_lib/rtabmap_msgs/CleanupLocalGrids.h | 136 ++ .../rtabmap_msgs/DetectMoreLoopClosures.h | 226 ++++ .../lib/ros_lib/rtabmap_msgs/EnvSensor.h | 73 ++ pio_workspace/lib/ros_lib/rtabmap_msgs/GPS.h | 68 + .../lib/ros_lib/rtabmap_msgs/GetMap.h | 130 ++ .../lib/ros_lib/rtabmap_msgs/GetMap2.h | 220 ++++ .../lib/ros_lib/rtabmap_msgs/GetNodeData.h | 212 +++ .../ros_lib/rtabmap_msgs/GetNodesInRadius.h | 328 +++++ .../lib/ros_lib/rtabmap_msgs/GetPlan.h | 130 ++ .../rtabmap_msgs/GlobalBundleAdjustment.h | 160 +++ .../ros_lib/rtabmap_msgs/GlobalDescriptor.h | 122 ++ pio_workspace/lib/ros_lib/rtabmap_msgs/Goal.h | 102 ++ pio_workspace/lib/ros_lib/rtabmap_msgs/Info.h | 778 +++++++++++ .../lib/ros_lib/rtabmap_msgs/KeyPoint.h | 164 +++ .../ros_lib/rtabmap_msgs/LandmarkDetection.h | 115 ++ .../ros_lib/rtabmap_msgs/LandmarkDetections.h | 70 + pio_workspace/lib/ros_lib/rtabmap_msgs/Link.h | 124 ++ .../lib/ros_lib/rtabmap_msgs/ListLabels.h | 151 +++ .../lib/ros_lib/rtabmap_msgs/LoadDatabase.h | 105 ++ .../lib/ros_lib/rtabmap_msgs/MapData.h | 76 ++ .../lib/ros_lib/rtabmap_msgs/MapGraph.h | 146 +++ pio_workspace/lib/ros_lib/rtabmap_msgs/Node.h | 311 +++++ .../lib/ros_lib/rtabmap_msgs/OdomInfo.h | 1158 +++++++++++++++++ pio_workspace/lib/ros_lib/rtabmap_msgs/Path.h | 114 ++ .../lib/ros_lib/rtabmap_msgs/Point2f.h | 86 ++ .../Point3f.h} | 84 +- .../lib/ros_lib/rtabmap_msgs/PublishMap.h | 124 ++ .../lib/ros_lib/rtabmap_msgs/RGBDImage.h | 162 +++ .../lib/ros_lib/rtabmap_msgs/RGBDImages.h | 70 + .../lib/ros_lib/rtabmap_msgs/RemoveLabel.h | 87 ++ .../lib/ros_lib/rtabmap_msgs/ResetPose.h | 214 +++ .../lib/ros_lib/rtabmap_msgs/ScanDescriptor.h | 62 + .../lib/ros_lib/rtabmap_msgs/SensorData.h | 613 +++++++++ .../lib/ros_lib/rtabmap_msgs/SetGoal.h | 222 ++++ .../lib/ros_lib/rtabmap_msgs/SetLabel.h | 111 ++ .../lib/ros_lib/rtabmap_msgs/UserData.h | 110 ++ .../ros_lib/theora_image_transport/Packet.h | 183 --- .../lib/ros_lib/turtle_actionlib/ShapeGoal.h | 86 -- .../ros_lib/turtle_actionlib/ShapeResult.h | 86 -- .../lib/ros_lib/turtle_actionlib/Velocity.h | 86 -- .../lib/ros_lib/turtlebot3_msgs/SensorState.h | 238 ++++ .../lib/ros_lib/turtlebot3_msgs/Sound.h | 51 + .../lib/ros_lib/turtlebot3_msgs/VersionInfo.h | 89 ++ pio_workspace/lib/ros_lib/turtlesim/Color.h | 59 - pio_workspace/lib/ros_lib/turtlesim/Kill.h | 87 -- pio_workspace/lib/ros_lib/turtlesim/Pose.h | 158 --- pio_workspace/lib/ros_lib/turtlesim/SetPen.h | 105 -- pio_workspace/lib/ros_lib/turtlesim/Spawn.h | 176 --- .../lib/ros_lib/turtlesim/TeleportRelative.h | 118 -- .../lib/ros_lib/uuid_msgs/UniqueID.h | 48 + .../ros_lib/velodyne_msgs/VelodynePacket.h | 72 + .../lib/ros_lib/velodyne_msgs/VelodyneScan.h | 70 + .../ros_lib/xsens_mti_driver/XsStatusWord.h | 383 ++++++ .../ros_lib/zed_interfaces/BoundingBox2Df.h | 47 + .../ros_lib/zed_interfaces/BoundingBox2Di.h | 47 + .../ros_lib/zed_interfaces/BoundingBox3D.h | 47 + .../lib/ros_lib/zed_interfaces/Keypoint2Df.h | 65 + .../lib/ros_lib/zed_interfaces/Keypoint2Di.h | 54 + .../lib/ros_lib/zed_interfaces/Keypoint3D.h | 65 + .../lib/ros_lib/zed_interfaces/Object.h | 378 ++++++ .../ros_lib/zed_interfaces/ObjectsStamped.h | 70 + .../lib/ros_lib/zed_interfaces/PlaneStamped.h | 106 ++ .../ros_lib/zed_interfaces/PosTrackStatus.h | 50 + .../lib/ros_lib/zed_interfaces/RGBDSensors.h | 78 ++ .../lib/ros_lib/zed_interfaces/Skeleton2D.h | 47 + .../lib/ros_lib/zed_interfaces/Skeleton3D.h | 47 + .../ros_lib/zed_interfaces/reset_odometry.h | 88 ++ .../lib/ros_lib/zed_interfaces/reset_roi.h | 88 ++ .../ros_lib/zed_interfaces/reset_tracking.h | 88 ++ .../lib/ros_lib/zed_interfaces/save_3d_map.h | 129 ++ .../ros_lib/zed_interfaces/save_area_memory.h | 122 ++ .../ros_lib/zed_interfaces/set_led_status.h | 106 ++ .../lib/ros_lib/zed_interfaces/set_pose.h | 232 ++++ .../lib/ros_lib/zed_interfaces/set_roi.h | 122 ++ .../ros_lib/zed_interfaces/start_3d_mapping.h | 160 +++ .../zed_interfaces/start_object_detection.h | 316 +++++ .../zed_interfaces/start_remote_stream.h | 110 ++ .../zed_interfaces/start_svo_recording.h | 122 ++ .../ros_lib/zed_interfaces/stop_3d_mapping.h | 88 ++ .../zed_interfaces/stop_object_detection.h | 88 ++ .../zed_interfaces/stop_remote_stream.h | 88 ++ .../zed_interfaces/stop_svo_recording.h | 105 ++ .../lib/ros_lib/zed_interfaces/toggle_led.h | 88 ++ 287 files changed, 31218 insertions(+), 4787 deletions(-) delete mode 100644 pio_workspace/lib/ros_lib/actionlib_tutorials/AveragingAction.h delete mode 100644 pio_workspace/lib/ros_lib/actionlib_tutorials/AveragingActionFeedback.h delete mode 100644 pio_workspace/lib/ros_lib/actionlib_tutorials/AveragingActionGoal.h delete mode 100644 pio_workspace/lib/ros_lib/actionlib_tutorials/AveragingActionResult.h delete mode 100644 pio_workspace/lib/ros_lib/actionlib_tutorials/AveragingFeedback.h delete mode 100644 pio_workspace/lib/ros_lib/actionlib_tutorials/AveragingGoal.h delete mode 100644 pio_workspace/lib/ros_lib/actionlib_tutorials/AveragingResult.h delete mode 100644 pio_workspace/lib/ros_lib/actionlib_tutorials/FibonacciAction.h delete mode 100644 pio_workspace/lib/ros_lib/actionlib_tutorials/FibonacciActionFeedback.h delete mode 100644 pio_workspace/lib/ros_lib/actionlib_tutorials/FibonacciActionGoal.h delete mode 100644 pio_workspace/lib/ros_lib/actionlib_tutorials/FibonacciActionResult.h delete mode 100644 pio_workspace/lib/ros_lib/actionlib_tutorials/FibonacciFeedback.h delete mode 100644 pio_workspace/lib/ros_lib/actionlib_tutorials/FibonacciGoal.h delete mode 100644 pio_workspace/lib/ros_lib/actionlib_tutorials/FibonacciResult.h create mode 100644 pio_workspace/lib/ros_lib/apriltag_ros/AnalyzeSingleImage.h create mode 100644 pio_workspace/lib/ros_lib/apriltag_ros/AprilTagDetection.h create mode 100644 pio_workspace/lib/ros_lib/apriltag_ros/AprilTagDetectionArray.h create mode 100644 pio_workspace/lib/ros_lib/base_local_planner/Position2DInt.h delete mode 100644 pio_workspace/lib/ros_lib/control_toolbox/SetPidGains.h delete mode 100644 pio_workspace/lib/ros_lib/controller_manager_msgs/ControllerState.h delete mode 100644 pio_workspace/lib/ros_lib/controller_manager_msgs/ControllerStatistics.h delete mode 100644 pio_workspace/lib/ros_lib/controller_manager_msgs/ControllersStatistics.h delete mode 100644 pio_workspace/lib/ros_lib/controller_manager_msgs/HardwareInterfaceResources.h delete mode 100644 pio_workspace/lib/ros_lib/controller_manager_msgs/ListControllerTypes.h delete mode 100644 pio_workspace/lib/ros_lib/controller_manager_msgs/ListControllers.h delete mode 100644 pio_workspace/lib/ros_lib/controller_manager_msgs/LoadController.h delete mode 100644 pio_workspace/lib/ros_lib/controller_manager_msgs/ReloadControllerLibraries.h delete mode 100644 pio_workspace/lib/ros_lib/controller_manager_msgs/SwitchController.h delete mode 100644 pio_workspace/lib/ros_lib/controller_manager_msgs/UnloadController.h create mode 100644 pio_workspace/lib/ros_lib/costmap_2d/VoxelGrid.h create mode 100644 pio_workspace/lib/ros_lib/find_object_2d/DetectionInfo.h create mode 100644 pio_workspace/lib/ros_lib/find_object_2d/ObjectsStamped.h create mode 100644 pio_workspace/lib/ros_lib/geographic_msgs/BoundingBox.h create mode 100644 pio_workspace/lib/ros_lib/geographic_msgs/GeoPath.h create mode 100644 pio_workspace/lib/ros_lib/geographic_msgs/GeoPoint.h create mode 100644 pio_workspace/lib/ros_lib/geographic_msgs/GeoPointStamped.h create mode 100644 pio_workspace/lib/ros_lib/geographic_msgs/GeoPose.h create mode 100644 pio_workspace/lib/ros_lib/geographic_msgs/GeoPoseStamped.h create mode 100644 pio_workspace/lib/ros_lib/geographic_msgs/GeographicMap.h create mode 100644 pio_workspace/lib/ros_lib/geographic_msgs/GeographicMapChanges.h create mode 100644 pio_workspace/lib/ros_lib/geographic_msgs/GetGeoPath.h create mode 100644 pio_workspace/lib/ros_lib/geographic_msgs/GetGeographicMap.h create mode 100644 pio_workspace/lib/ros_lib/geographic_msgs/GetRoutePlan.h create mode 100644 pio_workspace/lib/ros_lib/geographic_msgs/KeyValue.h create mode 100644 pio_workspace/lib/ros_lib/geographic_msgs/MapFeature.h create mode 100644 pio_workspace/lib/ros_lib/geographic_msgs/RouteNetwork.h create mode 100644 pio_workspace/lib/ros_lib/geographic_msgs/RoutePath.h create mode 100644 pio_workspace/lib/ros_lib/geographic_msgs/RouteSegment.h create mode 100644 pio_workspace/lib/ros_lib/geographic_msgs/UpdateGeographicMap.h create mode 100644 pio_workspace/lib/ros_lib/geographic_msgs/WayPoint.h create mode 100644 pio_workspace/lib/ros_lib/grid_map_msgs/GetGridMap.h create mode 100644 pio_workspace/lib/ros_lib/grid_map_msgs/GetGridMapInfo.h create mode 100644 pio_workspace/lib/ros_lib/grid_map_msgs/GridMap.h create mode 100644 pio_workspace/lib/ros_lib/grid_map_msgs/GridMapInfo.h create mode 100644 pio_workspace/lib/ros_lib/grid_map_msgs/ProcessFile.h create mode 100644 pio_workspace/lib/ros_lib/grid_map_msgs/SetGridMap.h create mode 100644 pio_workspace/lib/ros_lib/hector_mapping/HectorDebugInfo.h create mode 100644 pio_workspace/lib/ros_lib/hector_mapping/HectorIterData.h create mode 100644 pio_workspace/lib/ros_lib/hector_mapping/ResetMapping.h delete mode 100644 pio_workspace/lib/ros_lib/laser_assembler/AssembleScans.h delete mode 100644 pio_workspace/lib/ros_lib/laser_assembler/AssembleScans2.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/ADSBVehicle.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/ActuatorControl.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/Altitude.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/AttitudeTarget.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/BatteryStatus.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/CamIMUStamp.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/CameraImageCaptured.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/CellularStatus.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/CommandAck.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/CommandBool.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/CommandCode.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/CommandHome.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/CommandInt.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/CommandLong.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/CommandTOL.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/CommandTriggerControl.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/CommandTriggerInterval.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/CommandVtolTransition.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/CompanionProcessStatus.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/DebugValue.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/ESCInfo.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/ESCInfoItem.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/ESCStatus.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/ESCStatusItem.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/ESCTelemetry.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/ESCTelemetryItem.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/EstimatorStatus.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/ExtendedState.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/FileChecksum.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/FileClose.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/FileEntry.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/FileList.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/FileMakeDir.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/FileOpen.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/FileRead.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/FileRemove.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/FileRemoveDir.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/FileRename.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/FileTruncate.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/FileWrite.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/GPSINPUT.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/GPSRAW.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/GPSRTK.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/GlobalPositionTarget.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/HilActuatorControls.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/HilControls.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/HilGPS.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/HilSensor.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/HilStateQuaternion.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/HomePosition.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/LandingTarget.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/LogData.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/LogEntry.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/LogRequestData.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/LogRequestEnd.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/LogRequestList.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/MagnetometerReporter.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/ManualControl.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/Mavlink.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/MessageInterval.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/MountConfigure.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/MountControl.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/NavControllerOutput.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/OnboardComputerStatus.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/OpticalFlowRad.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/OverrideRCIn.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/Param.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/ParamGet.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/ParamPull.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/ParamPush.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/ParamSet.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/ParamValue.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/PlayTuneV2.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/PositionTarget.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/RCIn.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/RCOut.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/RTCM.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/RTKBaseline.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/RadioStatus.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/SetMavFrame.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/SetMode.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/State.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/StatusText.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/StreamRate.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/SysStatus.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/TerrainReport.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/Thrust.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/TimesyncStatus.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/Trajectory.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/Tunnel.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/VFR_HUD.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/VehicleInfo.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/VehicleInfoGet.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/Vibration.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/Waypoint.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/WaypointClear.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/WaypointList.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/WaypointPull.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/WaypointPush.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/WaypointReached.h create mode 100644 pio_workspace/lib/ros_lib/mavros_msgs/WaypointSetCurrent.h rename pio_workspace/lib/ros_lib/{rospy_tutorials/Floats.h => mavros_msgs/WheelOdomStamped.h} (55%) rename pio_workspace/lib/ros_lib/{turtle_actionlib/ShapeAction.h => move_base_msgs/MoveBaseAction.h} (57%) rename pio_workspace/lib/ros_lib/{turtle_actionlib/ShapeActionFeedback.h => move_base_msgs/MoveBaseActionFeedback.h} (67%) rename pio_workspace/lib/ros_lib/{turtle_actionlib/ShapeActionGoal.h => move_base_msgs/MoveBaseActionGoal.h} (68%) rename pio_workspace/lib/ros_lib/{turtle_actionlib/ShapeActionResult.h => move_base_msgs/MoveBaseActionResult.h} (67%) create mode 100644 pio_workspace/lib/ros_lib/move_base_msgs/MoveBaseFeedback.h create mode 100644 pio_workspace/lib/ros_lib/move_base_msgs/MoveBaseGoal.h rename pio_workspace/lib/ros_lib/{turtle_actionlib/ShapeFeedback.h => move_base_msgs/MoveBaseResult.h} (63%) create mode 100644 pio_workspace/lib/ros_lib/move_base_msgs/RecoveryStatus.h create mode 100644 pio_workspace/lib/ros_lib/navfn/MakeNavPlan.h create mode 100644 pio_workspace/lib/ros_lib/navfn/SetCostmap.h create mode 100644 pio_workspace/lib/ros_lib/octomap_msgs/BoundingBoxQuery.h create mode 100644 pio_workspace/lib/ros_lib/octomap_msgs/GetOctomap.h create mode 100644 pio_workspace/lib/ros_lib/octomap_msgs/Octomap.h create mode 100644 pio_workspace/lib/ros_lib/octomap_msgs/OctomapWithPose.h delete mode 100644 pio_workspace/lib/ros_lib/polled_camera/GetPolledImage.h create mode 100644 pio_workspace/lib/ros_lib/realsense2_camera/DeviceInfo.h create mode 100644 pio_workspace/lib/ros_lib/realsense2_camera/Extrinsics.h create mode 100644 pio_workspace/lib/ros_lib/realsense2_camera/IMUInfo.h create mode 100644 pio_workspace/lib/ros_lib/realsense2_camera/Metadata.h create mode 100644 pio_workspace/lib/ros_lib/robot_localization/FromLL.h create mode 100644 pio_workspace/lib/ros_lib/robot_localization/GetState.h create mode 100644 pio_workspace/lib/ros_lib/robot_localization/SetDatum.h create mode 100644 pio_workspace/lib/ros_lib/robot_localization/SetPose.h create mode 100644 pio_workspace/lib/ros_lib/robot_localization/SetUTMZone.h create mode 100644 pio_workspace/lib/ros_lib/robot_localization/ToLL.h create mode 100644 pio_workspace/lib/ros_lib/robot_localization/ToggleFilterProcessing.h delete mode 100644 pio_workspace/lib/ros_lib/roscpp_tutorials/TwoInts.h delete mode 100644 pio_workspace/lib/ros_lib/rospy_tutorials/AddTwoInts.h delete mode 100644 pio_workspace/lib/ros_lib/rospy_tutorials/BadTwoInts.h delete mode 100644 pio_workspace/lib/ros_lib/rospy_tutorials/HeaderString.h create mode 100644 pio_workspace/lib/ros_lib/rtabmap_msgs/AddLink.h create mode 100644 pio_workspace/lib/ros_lib/rtabmap_msgs/CameraModel.h create mode 100644 pio_workspace/lib/ros_lib/rtabmap_msgs/CameraModels.h create mode 100644 pio_workspace/lib/ros_lib/rtabmap_msgs/CleanupLocalGrids.h create mode 100644 pio_workspace/lib/ros_lib/rtabmap_msgs/DetectMoreLoopClosures.h create mode 100644 pio_workspace/lib/ros_lib/rtabmap_msgs/EnvSensor.h create mode 100644 pio_workspace/lib/ros_lib/rtabmap_msgs/GPS.h create mode 100644 pio_workspace/lib/ros_lib/rtabmap_msgs/GetMap.h create mode 100644 pio_workspace/lib/ros_lib/rtabmap_msgs/GetMap2.h create mode 100644 pio_workspace/lib/ros_lib/rtabmap_msgs/GetNodeData.h create mode 100644 pio_workspace/lib/ros_lib/rtabmap_msgs/GetNodesInRadius.h create mode 100644 pio_workspace/lib/ros_lib/rtabmap_msgs/GetPlan.h create mode 100644 pio_workspace/lib/ros_lib/rtabmap_msgs/GlobalBundleAdjustment.h create mode 100644 pio_workspace/lib/ros_lib/rtabmap_msgs/GlobalDescriptor.h create mode 100644 pio_workspace/lib/ros_lib/rtabmap_msgs/Goal.h create mode 100644 pio_workspace/lib/ros_lib/rtabmap_msgs/Info.h create mode 100644 pio_workspace/lib/ros_lib/rtabmap_msgs/KeyPoint.h create mode 100644 pio_workspace/lib/ros_lib/rtabmap_msgs/LandmarkDetection.h create mode 100644 pio_workspace/lib/ros_lib/rtabmap_msgs/LandmarkDetections.h create mode 100644 pio_workspace/lib/ros_lib/rtabmap_msgs/Link.h create mode 100644 pio_workspace/lib/ros_lib/rtabmap_msgs/ListLabels.h create mode 100644 pio_workspace/lib/ros_lib/rtabmap_msgs/LoadDatabase.h create mode 100644 pio_workspace/lib/ros_lib/rtabmap_msgs/MapData.h create mode 100644 pio_workspace/lib/ros_lib/rtabmap_msgs/MapGraph.h create mode 100644 pio_workspace/lib/ros_lib/rtabmap_msgs/Node.h create mode 100644 pio_workspace/lib/ros_lib/rtabmap_msgs/OdomInfo.h create mode 100644 pio_workspace/lib/ros_lib/rtabmap_msgs/Path.h create mode 100644 pio_workspace/lib/ros_lib/rtabmap_msgs/Point2f.h rename pio_workspace/lib/ros_lib/{turtlesim/TeleportAbsolute.h => rtabmap_msgs/Point3f.h} (53%) create mode 100644 pio_workspace/lib/ros_lib/rtabmap_msgs/PublishMap.h create mode 100644 pio_workspace/lib/ros_lib/rtabmap_msgs/RGBDImage.h create mode 100644 pio_workspace/lib/ros_lib/rtabmap_msgs/RGBDImages.h create mode 100644 pio_workspace/lib/ros_lib/rtabmap_msgs/RemoveLabel.h create mode 100644 pio_workspace/lib/ros_lib/rtabmap_msgs/ResetPose.h create mode 100644 pio_workspace/lib/ros_lib/rtabmap_msgs/ScanDescriptor.h create mode 100644 pio_workspace/lib/ros_lib/rtabmap_msgs/SensorData.h create mode 100644 pio_workspace/lib/ros_lib/rtabmap_msgs/SetGoal.h create mode 100644 pio_workspace/lib/ros_lib/rtabmap_msgs/SetLabel.h create mode 100644 pio_workspace/lib/ros_lib/rtabmap_msgs/UserData.h delete mode 100644 pio_workspace/lib/ros_lib/theora_image_transport/Packet.h delete mode 100644 pio_workspace/lib/ros_lib/turtle_actionlib/ShapeGoal.h delete mode 100644 pio_workspace/lib/ros_lib/turtle_actionlib/ShapeResult.h delete mode 100644 pio_workspace/lib/ros_lib/turtle_actionlib/Velocity.h create mode 100644 pio_workspace/lib/ros_lib/turtlebot3_msgs/SensorState.h create mode 100644 pio_workspace/lib/ros_lib/turtlebot3_msgs/Sound.h create mode 100644 pio_workspace/lib/ros_lib/turtlebot3_msgs/VersionInfo.h delete mode 100644 pio_workspace/lib/ros_lib/turtlesim/Color.h delete mode 100644 pio_workspace/lib/ros_lib/turtlesim/Kill.h delete mode 100644 pio_workspace/lib/ros_lib/turtlesim/Pose.h delete mode 100644 pio_workspace/lib/ros_lib/turtlesim/SetPen.h delete mode 100644 pio_workspace/lib/ros_lib/turtlesim/Spawn.h delete mode 100644 pio_workspace/lib/ros_lib/turtlesim/TeleportRelative.h create mode 100644 pio_workspace/lib/ros_lib/uuid_msgs/UniqueID.h create mode 100644 pio_workspace/lib/ros_lib/velodyne_msgs/VelodynePacket.h create mode 100644 pio_workspace/lib/ros_lib/velodyne_msgs/VelodyneScan.h create mode 100644 pio_workspace/lib/ros_lib/xsens_mti_driver/XsStatusWord.h create mode 100644 pio_workspace/lib/ros_lib/zed_interfaces/BoundingBox2Df.h create mode 100644 pio_workspace/lib/ros_lib/zed_interfaces/BoundingBox2Di.h create mode 100644 pio_workspace/lib/ros_lib/zed_interfaces/BoundingBox3D.h create mode 100644 pio_workspace/lib/ros_lib/zed_interfaces/Keypoint2Df.h create mode 100644 pio_workspace/lib/ros_lib/zed_interfaces/Keypoint2Di.h create mode 100644 pio_workspace/lib/ros_lib/zed_interfaces/Keypoint3D.h create mode 100644 pio_workspace/lib/ros_lib/zed_interfaces/Object.h create mode 100644 pio_workspace/lib/ros_lib/zed_interfaces/ObjectsStamped.h create mode 100644 pio_workspace/lib/ros_lib/zed_interfaces/PlaneStamped.h create mode 100644 pio_workspace/lib/ros_lib/zed_interfaces/PosTrackStatus.h create mode 100644 pio_workspace/lib/ros_lib/zed_interfaces/RGBDSensors.h create mode 100644 pio_workspace/lib/ros_lib/zed_interfaces/Skeleton2D.h create mode 100644 pio_workspace/lib/ros_lib/zed_interfaces/Skeleton3D.h create mode 100644 pio_workspace/lib/ros_lib/zed_interfaces/reset_odometry.h create mode 100644 pio_workspace/lib/ros_lib/zed_interfaces/reset_roi.h create mode 100644 pio_workspace/lib/ros_lib/zed_interfaces/reset_tracking.h create mode 100644 pio_workspace/lib/ros_lib/zed_interfaces/save_3d_map.h create mode 100644 pio_workspace/lib/ros_lib/zed_interfaces/save_area_memory.h create mode 100644 pio_workspace/lib/ros_lib/zed_interfaces/set_led_status.h create mode 100644 pio_workspace/lib/ros_lib/zed_interfaces/set_pose.h create mode 100644 pio_workspace/lib/ros_lib/zed_interfaces/set_roi.h create mode 100644 pio_workspace/lib/ros_lib/zed_interfaces/start_3d_mapping.h create mode 100644 pio_workspace/lib/ros_lib/zed_interfaces/start_object_detection.h create mode 100644 pio_workspace/lib/ros_lib/zed_interfaces/start_remote_stream.h create mode 100644 pio_workspace/lib/ros_lib/zed_interfaces/start_svo_recording.h create mode 100644 pio_workspace/lib/ros_lib/zed_interfaces/stop_3d_mapping.h create mode 100644 pio_workspace/lib/ros_lib/zed_interfaces/stop_object_detection.h create mode 100644 pio_workspace/lib/ros_lib/zed_interfaces/stop_remote_stream.h create mode 100644 pio_workspace/lib/ros_lib/zed_interfaces/stop_svo_recording.h create mode 100644 pio_workspace/lib/ros_lib/zed_interfaces/toggle_led.h diff --git a/pio_workspace/lib/ros_lib/actionlib_tutorials/AveragingAction.h b/pio_workspace/lib/ros_lib/actionlib_tutorials/AveragingAction.h deleted file mode 100644 index 4d3205f..0000000 --- a/pio_workspace/lib/ros_lib/actionlib_tutorials/AveragingAction.h +++ /dev/null @@ -1,56 +0,0 @@ -#ifndef _ROS_actionlib_tutorials_AveragingAction_h -#define _ROS_actionlib_tutorials_AveragingAction_h - -#include -#include -#include -#include "ros/msg.h" -#include "actionlib_tutorials/AveragingActionGoal.h" -#include "actionlib_tutorials/AveragingActionResult.h" -#include "actionlib_tutorials/AveragingActionFeedback.h" - -namespace actionlib_tutorials -{ - - class AveragingAction : public ros::Msg - { - public: - typedef actionlib_tutorials::AveragingActionGoal _action_goal_type; - _action_goal_type action_goal; - typedef actionlib_tutorials::AveragingActionResult _action_result_type; - _action_result_type action_result; - typedef actionlib_tutorials::AveragingActionFeedback _action_feedback_type; - _action_feedback_type action_feedback; - - AveragingAction(): - action_goal(), - action_result(), - action_feedback() - { - } - - virtual int serialize(unsigned char *outbuffer) const override - { - int offset = 0; - offset += this->action_goal.serialize(outbuffer + offset); - offset += this->action_result.serialize(outbuffer + offset); - offset += this->action_feedback.serialize(outbuffer + offset); - return offset; - } - - virtual int deserialize(unsigned char *inbuffer) override - { - int offset = 0; - offset += this->action_goal.deserialize(inbuffer + offset); - offset += this->action_result.deserialize(inbuffer + offset); - offset += this->action_feedback.deserialize(inbuffer + offset); - return offset; - } - - virtual const char * getType() override { return "actionlib_tutorials/AveragingAction"; }; - virtual const char * getMD5() override { return "628678f2b4fa6a5951746a4a2d39e716"; }; - - }; - -} -#endif diff --git a/pio_workspace/lib/ros_lib/actionlib_tutorials/AveragingActionFeedback.h b/pio_workspace/lib/ros_lib/actionlib_tutorials/AveragingActionFeedback.h deleted file mode 100644 index 0982247..0000000 --- a/pio_workspace/lib/ros_lib/actionlib_tutorials/AveragingActionFeedback.h +++ /dev/null @@ -1,56 +0,0 @@ -#ifndef _ROS_actionlib_tutorials_AveragingActionFeedback_h -#define _ROS_actionlib_tutorials_AveragingActionFeedback_h - -#include -#include -#include -#include "ros/msg.h" -#include "std_msgs/Header.h" -#include "actionlib_msgs/GoalStatus.h" -#include "actionlib_tutorials/AveragingFeedback.h" - -namespace actionlib_tutorials -{ - - class AveragingActionFeedback : public ros::Msg - { - public: - typedef std_msgs::Header _header_type; - _header_type header; - typedef actionlib_msgs::GoalStatus _status_type; - _status_type status; - typedef actionlib_tutorials::AveragingFeedback _feedback_type; - _feedback_type feedback; - - AveragingActionFeedback(): - header(), - status(), - feedback() - { - } - - virtual int serialize(unsigned char *outbuffer) const override - { - int offset = 0; - offset += this->header.serialize(outbuffer + offset); - offset += this->status.serialize(outbuffer + offset); - offset += this->feedback.serialize(outbuffer + offset); - return offset; - } - - virtual int deserialize(unsigned char *inbuffer) override - { - int offset = 0; - offset += this->header.deserialize(inbuffer + offset); - offset += this->status.deserialize(inbuffer + offset); - offset += this->feedback.deserialize(inbuffer + offset); - return offset; - } - - virtual const char * getType() override { return "actionlib_tutorials/AveragingActionFeedback"; }; - virtual const char * getMD5() override { return "78a4a09241b1791069223ae7ebd5b16b"; }; - - }; - -} -#endif diff --git a/pio_workspace/lib/ros_lib/actionlib_tutorials/AveragingActionGoal.h b/pio_workspace/lib/ros_lib/actionlib_tutorials/AveragingActionGoal.h deleted file mode 100644 index d70aba1..0000000 --- a/pio_workspace/lib/ros_lib/actionlib_tutorials/AveragingActionGoal.h +++ /dev/null @@ -1,56 +0,0 @@ -#ifndef _ROS_actionlib_tutorials_AveragingActionGoal_h -#define _ROS_actionlib_tutorials_AveragingActionGoal_h - -#include -#include -#include -#include "ros/msg.h" -#include "std_msgs/Header.h" -#include "actionlib_msgs/GoalID.h" -#include "actionlib_tutorials/AveragingGoal.h" - -namespace actionlib_tutorials -{ - - class AveragingActionGoal : public ros::Msg - { - public: - typedef std_msgs::Header _header_type; - _header_type header; - typedef actionlib_msgs::GoalID _goal_id_type; - _goal_id_type goal_id; - typedef actionlib_tutorials::AveragingGoal _goal_type; - _goal_type goal; - - AveragingActionGoal(): - header(), - goal_id(), - goal() - { - } - - virtual int serialize(unsigned char *outbuffer) const override - { - int offset = 0; - offset += this->header.serialize(outbuffer + offset); - offset += this->goal_id.serialize(outbuffer + offset); - offset += this->goal.serialize(outbuffer + offset); - return offset; - } - - virtual int deserialize(unsigned char *inbuffer) override - { - int offset = 0; - offset += this->header.deserialize(inbuffer + offset); - offset += this->goal_id.deserialize(inbuffer + offset); - offset += this->goal.deserialize(inbuffer + offset); - return offset; - } - - virtual const char * getType() override { return "actionlib_tutorials/AveragingActionGoal"; }; - virtual const char * getMD5() override { return "1561825b734ebd6039851c501e3fb570"; }; - - }; - -} -#endif diff --git a/pio_workspace/lib/ros_lib/actionlib_tutorials/AveragingActionResult.h b/pio_workspace/lib/ros_lib/actionlib_tutorials/AveragingActionResult.h deleted file mode 100644 index 5c7270c..0000000 --- a/pio_workspace/lib/ros_lib/actionlib_tutorials/AveragingActionResult.h +++ /dev/null @@ -1,56 +0,0 @@ -#ifndef _ROS_actionlib_tutorials_AveragingActionResult_h -#define _ROS_actionlib_tutorials_AveragingActionResult_h - -#include -#include -#include -#include "ros/msg.h" -#include "std_msgs/Header.h" -#include "actionlib_msgs/GoalStatus.h" -#include "actionlib_tutorials/AveragingResult.h" - -namespace actionlib_tutorials -{ - - class AveragingActionResult : public ros::Msg - { - public: - typedef std_msgs::Header _header_type; - _header_type header; - typedef actionlib_msgs::GoalStatus _status_type; - _status_type status; - typedef actionlib_tutorials::AveragingResult _result_type; - _result_type result; - - AveragingActionResult(): - header(), - status(), - result() - { - } - - virtual int serialize(unsigned char *outbuffer) const override - { - int offset = 0; - offset += this->header.serialize(outbuffer + offset); - offset += this->status.serialize(outbuffer + offset); - offset += this->result.serialize(outbuffer + offset); - return offset; - } - - virtual int deserialize(unsigned char *inbuffer) override - { - int offset = 0; - offset += this->header.deserialize(inbuffer + offset); - offset += this->status.deserialize(inbuffer + offset); - offset += this->result.deserialize(inbuffer + offset); - return offset; - } - - virtual const char * getType() override { return "actionlib_tutorials/AveragingActionResult"; }; - virtual const char * getMD5() override { return "8672cb489d347580acdcd05c5d497497"; }; - - }; - -} -#endif diff --git a/pio_workspace/lib/ros_lib/actionlib_tutorials/AveragingFeedback.h b/pio_workspace/lib/ros_lib/actionlib_tutorials/AveragingFeedback.h deleted file mode 100644 index 9d3db93..0000000 --- a/pio_workspace/lib/ros_lib/actionlib_tutorials/AveragingFeedback.h +++ /dev/null @@ -1,134 +0,0 @@ -#ifndef _ROS_actionlib_tutorials_AveragingFeedback_h -#define _ROS_actionlib_tutorials_AveragingFeedback_h - -#include -#include -#include -#include "ros/msg.h" - -namespace actionlib_tutorials -{ - - class AveragingFeedback : public ros::Msg - { - public: - typedef int32_t _sample_type; - _sample_type sample; - typedef float _data_type; - _data_type data; - typedef float _mean_type; - _mean_type mean; - typedef float _std_dev_type; - _std_dev_type std_dev; - - AveragingFeedback(): - sample(0), - data(0), - mean(0), - std_dev(0) - { - } - - virtual int serialize(unsigned char *outbuffer) const override - { - int offset = 0; - union { - int32_t real; - uint32_t base; - } u_sample; - u_sample.real = this->sample; - *(outbuffer + offset + 0) = (u_sample.base >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (u_sample.base >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (u_sample.base >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (u_sample.base >> (8 * 3)) & 0xFF; - offset += sizeof(this->sample); - union { - float real; - uint32_t base; - } u_data; - u_data.real = this->data; - *(outbuffer + offset + 0) = (u_data.base >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (u_data.base >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (u_data.base >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (u_data.base >> (8 * 3)) & 0xFF; - offset += sizeof(this->data); - union { - float real; - uint32_t base; - } u_mean; - u_mean.real = this->mean; - *(outbuffer + offset + 0) = (u_mean.base >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (u_mean.base >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (u_mean.base >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (u_mean.base >> (8 * 3)) & 0xFF; - offset += sizeof(this->mean); - union { - float real; - uint32_t base; - } u_std_dev; - u_std_dev.real = this->std_dev; - *(outbuffer + offset + 0) = (u_std_dev.base >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (u_std_dev.base >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (u_std_dev.base >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (u_std_dev.base >> (8 * 3)) & 0xFF; - offset += sizeof(this->std_dev); - return offset; - } - - virtual int deserialize(unsigned char *inbuffer) override - { - int offset = 0; - union { - int32_t real; - uint32_t base; - } u_sample; - u_sample.base = 0; - u_sample.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); - u_sample.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - u_sample.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - u_sample.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - this->sample = u_sample.real; - offset += sizeof(this->sample); - union { - float real; - uint32_t base; - } u_data; - u_data.base = 0; - u_data.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); - u_data.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - u_data.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - u_data.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - this->data = u_data.real; - offset += sizeof(this->data); - union { - float real; - uint32_t base; - } u_mean; - u_mean.base = 0; - u_mean.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); - u_mean.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - u_mean.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - u_mean.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - this->mean = u_mean.real; - offset += sizeof(this->mean); - union { - float real; - uint32_t base; - } u_std_dev; - u_std_dev.base = 0; - u_std_dev.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); - u_std_dev.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - u_std_dev.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - u_std_dev.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - this->std_dev = u_std_dev.real; - offset += sizeof(this->std_dev); - return offset; - } - - virtual const char * getType() override { return "actionlib_tutorials/AveragingFeedback"; }; - virtual const char * getMD5() override { return "9e8dfc53c2f2a032ca33fa80ec46fd4f"; }; - - }; - -} -#endif diff --git a/pio_workspace/lib/ros_lib/actionlib_tutorials/AveragingGoal.h b/pio_workspace/lib/ros_lib/actionlib_tutorials/AveragingGoal.h deleted file mode 100644 index 837d335..0000000 --- a/pio_workspace/lib/ros_lib/actionlib_tutorials/AveragingGoal.h +++ /dev/null @@ -1,62 +0,0 @@ -#ifndef _ROS_actionlib_tutorials_AveragingGoal_h -#define _ROS_actionlib_tutorials_AveragingGoal_h - -#include -#include -#include -#include "ros/msg.h" - -namespace actionlib_tutorials -{ - - class AveragingGoal : public ros::Msg - { - public: - typedef int32_t _samples_type; - _samples_type samples; - - AveragingGoal(): - samples(0) - { - } - - virtual int serialize(unsigned char *outbuffer) const override - { - int offset = 0; - union { - int32_t real; - uint32_t base; - } u_samples; - u_samples.real = this->samples; - *(outbuffer + offset + 0) = (u_samples.base >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (u_samples.base >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (u_samples.base >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (u_samples.base >> (8 * 3)) & 0xFF; - offset += sizeof(this->samples); - return offset; - } - - virtual int deserialize(unsigned char *inbuffer) override - { - int offset = 0; - union { - int32_t real; - uint32_t base; - } u_samples; - u_samples.base = 0; - u_samples.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); - u_samples.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - u_samples.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - u_samples.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - this->samples = u_samples.real; - offset += sizeof(this->samples); - return offset; - } - - virtual const char * getType() override { return "actionlib_tutorials/AveragingGoal"; }; - virtual const char * getMD5() override { return "32c9b10ef9b253faa93b93f564762c8f"; }; - - }; - -} -#endif diff --git a/pio_workspace/lib/ros_lib/actionlib_tutorials/AveragingResult.h b/pio_workspace/lib/ros_lib/actionlib_tutorials/AveragingResult.h deleted file mode 100644 index e8dfa44..0000000 --- a/pio_workspace/lib/ros_lib/actionlib_tutorials/AveragingResult.h +++ /dev/null @@ -1,86 +0,0 @@ -#ifndef _ROS_actionlib_tutorials_AveragingResult_h -#define _ROS_actionlib_tutorials_AveragingResult_h - -#include -#include -#include -#include "ros/msg.h" - -namespace actionlib_tutorials -{ - - class AveragingResult : public ros::Msg - { - public: - typedef float _mean_type; - _mean_type mean; - typedef float _std_dev_type; - _std_dev_type std_dev; - - AveragingResult(): - mean(0), - std_dev(0) - { - } - - virtual int serialize(unsigned char *outbuffer) const override - { - int offset = 0; - union { - float real; - uint32_t base; - } u_mean; - u_mean.real = this->mean; - *(outbuffer + offset + 0) = (u_mean.base >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (u_mean.base >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (u_mean.base >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (u_mean.base >> (8 * 3)) & 0xFF; - offset += sizeof(this->mean); - union { - float real; - uint32_t base; - } u_std_dev; - u_std_dev.real = this->std_dev; - *(outbuffer + offset + 0) = (u_std_dev.base >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (u_std_dev.base >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (u_std_dev.base >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (u_std_dev.base >> (8 * 3)) & 0xFF; - offset += sizeof(this->std_dev); - return offset; - } - - virtual int deserialize(unsigned char *inbuffer) override - { - int offset = 0; - union { - float real; - uint32_t base; - } u_mean; - u_mean.base = 0; - u_mean.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); - u_mean.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - u_mean.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - u_mean.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - this->mean = u_mean.real; - offset += sizeof(this->mean); - union { - float real; - uint32_t base; - } u_std_dev; - u_std_dev.base = 0; - u_std_dev.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); - u_std_dev.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - u_std_dev.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - u_std_dev.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - this->std_dev = u_std_dev.real; - offset += sizeof(this->std_dev); - return offset; - } - - virtual const char * getType() override { return "actionlib_tutorials/AveragingResult"; }; - virtual const char * getMD5() override { return "d5c7decf6df75ffb4367a05c1bcc7612"; }; - - }; - -} -#endif diff --git a/pio_workspace/lib/ros_lib/actionlib_tutorials/FibonacciAction.h b/pio_workspace/lib/ros_lib/actionlib_tutorials/FibonacciAction.h deleted file mode 100644 index f9047ba..0000000 --- a/pio_workspace/lib/ros_lib/actionlib_tutorials/FibonacciAction.h +++ /dev/null @@ -1,56 +0,0 @@ -#ifndef _ROS_actionlib_tutorials_FibonacciAction_h -#define _ROS_actionlib_tutorials_FibonacciAction_h - -#include -#include -#include -#include "ros/msg.h" -#include "actionlib_tutorials/FibonacciActionGoal.h" -#include "actionlib_tutorials/FibonacciActionResult.h" -#include "actionlib_tutorials/FibonacciActionFeedback.h" - -namespace actionlib_tutorials -{ - - class FibonacciAction : public ros::Msg - { - public: - typedef actionlib_tutorials::FibonacciActionGoal _action_goal_type; - _action_goal_type action_goal; - typedef actionlib_tutorials::FibonacciActionResult _action_result_type; - _action_result_type action_result; - typedef actionlib_tutorials::FibonacciActionFeedback _action_feedback_type; - _action_feedback_type action_feedback; - - FibonacciAction(): - action_goal(), - action_result(), - action_feedback() - { - } - - virtual int serialize(unsigned char *outbuffer) const override - { - int offset = 0; - offset += this->action_goal.serialize(outbuffer + offset); - offset += this->action_result.serialize(outbuffer + offset); - offset += this->action_feedback.serialize(outbuffer + offset); - return offset; - } - - virtual int deserialize(unsigned char *inbuffer) override - { - int offset = 0; - offset += this->action_goal.deserialize(inbuffer + offset); - offset += this->action_result.deserialize(inbuffer + offset); - offset += this->action_feedback.deserialize(inbuffer + offset); - return offset; - } - - virtual const char * getType() override { return "actionlib_tutorials/FibonacciAction"; }; - virtual const char * getMD5() override { return "f59df5767bf7634684781c92598b2406"; }; - - }; - -} -#endif diff --git a/pio_workspace/lib/ros_lib/actionlib_tutorials/FibonacciActionFeedback.h b/pio_workspace/lib/ros_lib/actionlib_tutorials/FibonacciActionFeedback.h deleted file mode 100644 index 8d72567..0000000 --- a/pio_workspace/lib/ros_lib/actionlib_tutorials/FibonacciActionFeedback.h +++ /dev/null @@ -1,56 +0,0 @@ -#ifndef _ROS_actionlib_tutorials_FibonacciActionFeedback_h -#define _ROS_actionlib_tutorials_FibonacciActionFeedback_h - -#include -#include -#include -#include "ros/msg.h" -#include "std_msgs/Header.h" -#include "actionlib_msgs/GoalStatus.h" -#include "actionlib_tutorials/FibonacciFeedback.h" - -namespace actionlib_tutorials -{ - - class FibonacciActionFeedback : public ros::Msg - { - public: - typedef std_msgs::Header _header_type; - _header_type header; - typedef actionlib_msgs::GoalStatus _status_type; - _status_type status; - typedef actionlib_tutorials::FibonacciFeedback _feedback_type; - _feedback_type feedback; - - FibonacciActionFeedback(): - header(), - status(), - feedback() - { - } - - virtual int serialize(unsigned char *outbuffer) const override - { - int offset = 0; - offset += this->header.serialize(outbuffer + offset); - offset += this->status.serialize(outbuffer + offset); - offset += this->feedback.serialize(outbuffer + offset); - return offset; - } - - virtual int deserialize(unsigned char *inbuffer) override - { - int offset = 0; - offset += this->header.deserialize(inbuffer + offset); - offset += this->status.deserialize(inbuffer + offset); - offset += this->feedback.deserialize(inbuffer + offset); - return offset; - } - - virtual const char * getType() override { return "actionlib_tutorials/FibonacciActionFeedback"; }; - virtual const char * getMD5() override { return "73b8497a9f629a31c0020900e4148f07"; }; - - }; - -} -#endif diff --git a/pio_workspace/lib/ros_lib/actionlib_tutorials/FibonacciActionGoal.h b/pio_workspace/lib/ros_lib/actionlib_tutorials/FibonacciActionGoal.h deleted file mode 100644 index 5428d70..0000000 --- a/pio_workspace/lib/ros_lib/actionlib_tutorials/FibonacciActionGoal.h +++ /dev/null @@ -1,56 +0,0 @@ -#ifndef _ROS_actionlib_tutorials_FibonacciActionGoal_h -#define _ROS_actionlib_tutorials_FibonacciActionGoal_h - -#include -#include -#include -#include "ros/msg.h" -#include "std_msgs/Header.h" -#include "actionlib_msgs/GoalID.h" -#include "actionlib_tutorials/FibonacciGoal.h" - -namespace actionlib_tutorials -{ - - class FibonacciActionGoal : public ros::Msg - { - public: - typedef std_msgs::Header _header_type; - _header_type header; - typedef actionlib_msgs::GoalID _goal_id_type; - _goal_id_type goal_id; - typedef actionlib_tutorials::FibonacciGoal _goal_type; - _goal_type goal; - - FibonacciActionGoal(): - header(), - goal_id(), - goal() - { - } - - virtual int serialize(unsigned char *outbuffer) const override - { - int offset = 0; - offset += this->header.serialize(outbuffer + offset); - offset += this->goal_id.serialize(outbuffer + offset); - offset += this->goal.serialize(outbuffer + offset); - return offset; - } - - virtual int deserialize(unsigned char *inbuffer) override - { - int offset = 0; - offset += this->header.deserialize(inbuffer + offset); - offset += this->goal_id.deserialize(inbuffer + offset); - offset += this->goal.deserialize(inbuffer + offset); - return offset; - } - - virtual const char * getType() override { return "actionlib_tutorials/FibonacciActionGoal"; }; - virtual const char * getMD5() override { return "006871c7fa1d0e3d5fe2226bf17b2a94"; }; - - }; - -} -#endif diff --git a/pio_workspace/lib/ros_lib/actionlib_tutorials/FibonacciActionResult.h b/pio_workspace/lib/ros_lib/actionlib_tutorials/FibonacciActionResult.h deleted file mode 100644 index 0a3edc6..0000000 --- a/pio_workspace/lib/ros_lib/actionlib_tutorials/FibonacciActionResult.h +++ /dev/null @@ -1,56 +0,0 @@ -#ifndef _ROS_actionlib_tutorials_FibonacciActionResult_h -#define _ROS_actionlib_tutorials_FibonacciActionResult_h - -#include -#include -#include -#include "ros/msg.h" -#include "std_msgs/Header.h" -#include "actionlib_msgs/GoalStatus.h" -#include "actionlib_tutorials/FibonacciResult.h" - -namespace actionlib_tutorials -{ - - class FibonacciActionResult : public ros::Msg - { - public: - typedef std_msgs::Header _header_type; - _header_type header; - typedef actionlib_msgs::GoalStatus _status_type; - _status_type status; - typedef actionlib_tutorials::FibonacciResult _result_type; - _result_type result; - - FibonacciActionResult(): - header(), - status(), - result() - { - } - - virtual int serialize(unsigned char *outbuffer) const override - { - int offset = 0; - offset += this->header.serialize(outbuffer + offset); - offset += this->status.serialize(outbuffer + offset); - offset += this->result.serialize(outbuffer + offset); - return offset; - } - - virtual int deserialize(unsigned char *inbuffer) override - { - int offset = 0; - offset += this->header.deserialize(inbuffer + offset); - offset += this->status.deserialize(inbuffer + offset); - offset += this->result.deserialize(inbuffer + offset); - return offset; - } - - virtual const char * getType() override { return "actionlib_tutorials/FibonacciActionResult"; }; - virtual const char * getMD5() override { return "bee73a9fe29ae25e966e105f5553dd03"; }; - - }; - -} -#endif diff --git a/pio_workspace/lib/ros_lib/actionlib_tutorials/FibonacciFeedback.h b/pio_workspace/lib/ros_lib/actionlib_tutorials/FibonacciFeedback.h deleted file mode 100644 index ac3af91..0000000 --- a/pio_workspace/lib/ros_lib/actionlib_tutorials/FibonacciFeedback.h +++ /dev/null @@ -1,82 +0,0 @@ -#ifndef _ROS_actionlib_tutorials_FibonacciFeedback_h -#define _ROS_actionlib_tutorials_FibonacciFeedback_h - -#include -#include -#include -#include "ros/msg.h" - -namespace actionlib_tutorials -{ - - class FibonacciFeedback : public ros::Msg - { - public: - uint32_t sequence_length; - typedef int32_t _sequence_type; - _sequence_type st_sequence; - _sequence_type * sequence; - - FibonacciFeedback(): - sequence_length(0), st_sequence(), sequence(nullptr) - { - } - - virtual int serialize(unsigned char *outbuffer) const override - { - int offset = 0; - *(outbuffer + offset + 0) = (this->sequence_length >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (this->sequence_length >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (this->sequence_length >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (this->sequence_length >> (8 * 3)) & 0xFF; - offset += sizeof(this->sequence_length); - for( uint32_t i = 0; i < sequence_length; i++){ - union { - int32_t real; - uint32_t base; - } u_sequencei; - u_sequencei.real = this->sequence[i]; - *(outbuffer + offset + 0) = (u_sequencei.base >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (u_sequencei.base >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (u_sequencei.base >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (u_sequencei.base >> (8 * 3)) & 0xFF; - offset += sizeof(this->sequence[i]); - } - return offset; - } - - virtual int deserialize(unsigned char *inbuffer) override - { - int offset = 0; - uint32_t sequence_lengthT = ((uint32_t) (*(inbuffer + offset))); - sequence_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - sequence_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - sequence_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - offset += sizeof(this->sequence_length); - if(sequence_lengthT > sequence_length) - this->sequence = (int32_t*)realloc(this->sequence, sequence_lengthT * sizeof(int32_t)); - sequence_length = sequence_lengthT; - for( uint32_t i = 0; i < sequence_length; i++){ - union { - int32_t real; - uint32_t base; - } u_st_sequence; - u_st_sequence.base = 0; - u_st_sequence.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); - u_st_sequence.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - u_st_sequence.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - u_st_sequence.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - this->st_sequence = u_st_sequence.real; - offset += sizeof(this->st_sequence); - memcpy( &(this->sequence[i]), &(this->st_sequence), sizeof(int32_t)); - } - return offset; - } - - virtual const char * getType() override { return "actionlib_tutorials/FibonacciFeedback"; }; - virtual const char * getMD5() override { return "b81e37d2a31925a0e8ae261a8699cb79"; }; - - }; - -} -#endif diff --git a/pio_workspace/lib/ros_lib/actionlib_tutorials/FibonacciGoal.h b/pio_workspace/lib/ros_lib/actionlib_tutorials/FibonacciGoal.h deleted file mode 100644 index c8dd567..0000000 --- a/pio_workspace/lib/ros_lib/actionlib_tutorials/FibonacciGoal.h +++ /dev/null @@ -1,62 +0,0 @@ -#ifndef _ROS_actionlib_tutorials_FibonacciGoal_h -#define _ROS_actionlib_tutorials_FibonacciGoal_h - -#include -#include -#include -#include "ros/msg.h" - -namespace actionlib_tutorials -{ - - class FibonacciGoal : public ros::Msg - { - public: - typedef int32_t _order_type; - _order_type order; - - FibonacciGoal(): - order(0) - { - } - - virtual int serialize(unsigned char *outbuffer) const override - { - int offset = 0; - union { - int32_t real; - uint32_t base; - } u_order; - u_order.real = this->order; - *(outbuffer + offset + 0) = (u_order.base >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (u_order.base >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (u_order.base >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (u_order.base >> (8 * 3)) & 0xFF; - offset += sizeof(this->order); - return offset; - } - - virtual int deserialize(unsigned char *inbuffer) override - { - int offset = 0; - union { - int32_t real; - uint32_t base; - } u_order; - u_order.base = 0; - u_order.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); - u_order.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - u_order.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - u_order.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - this->order = u_order.real; - offset += sizeof(this->order); - return offset; - } - - virtual const char * getType() override { return "actionlib_tutorials/FibonacciGoal"; }; - virtual const char * getMD5() override { return "6889063349a00b249bd1661df429d822"; }; - - }; - -} -#endif diff --git a/pio_workspace/lib/ros_lib/actionlib_tutorials/FibonacciResult.h b/pio_workspace/lib/ros_lib/actionlib_tutorials/FibonacciResult.h deleted file mode 100644 index 40c703e..0000000 --- a/pio_workspace/lib/ros_lib/actionlib_tutorials/FibonacciResult.h +++ /dev/null @@ -1,82 +0,0 @@ -#ifndef _ROS_actionlib_tutorials_FibonacciResult_h -#define _ROS_actionlib_tutorials_FibonacciResult_h - -#include -#include -#include -#include "ros/msg.h" - -namespace actionlib_tutorials -{ - - class FibonacciResult : public ros::Msg - { - public: - uint32_t sequence_length; - typedef int32_t _sequence_type; - _sequence_type st_sequence; - _sequence_type * sequence; - - FibonacciResult(): - sequence_length(0), st_sequence(), sequence(nullptr) - { - } - - virtual int serialize(unsigned char *outbuffer) const override - { - int offset = 0; - *(outbuffer + offset + 0) = (this->sequence_length >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (this->sequence_length >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (this->sequence_length >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (this->sequence_length >> (8 * 3)) & 0xFF; - offset += sizeof(this->sequence_length); - for( uint32_t i = 0; i < sequence_length; i++){ - union { - int32_t real; - uint32_t base; - } u_sequencei; - u_sequencei.real = this->sequence[i]; - *(outbuffer + offset + 0) = (u_sequencei.base >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (u_sequencei.base >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (u_sequencei.base >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (u_sequencei.base >> (8 * 3)) & 0xFF; - offset += sizeof(this->sequence[i]); - } - return offset; - } - - virtual int deserialize(unsigned char *inbuffer) override - { - int offset = 0; - uint32_t sequence_lengthT = ((uint32_t) (*(inbuffer + offset))); - sequence_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - sequence_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - sequence_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - offset += sizeof(this->sequence_length); - if(sequence_lengthT > sequence_length) - this->sequence = (int32_t*)realloc(this->sequence, sequence_lengthT * sizeof(int32_t)); - sequence_length = sequence_lengthT; - for( uint32_t i = 0; i < sequence_length; i++){ - union { - int32_t real; - uint32_t base; - } u_st_sequence; - u_st_sequence.base = 0; - u_st_sequence.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); - u_st_sequence.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - u_st_sequence.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - u_st_sequence.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - this->st_sequence = u_st_sequence.real; - offset += sizeof(this->st_sequence); - memcpy( &(this->sequence[i]), &(this->st_sequence), sizeof(int32_t)); - } - return offset; - } - - virtual const char * getType() override { return "actionlib_tutorials/FibonacciResult"; }; - virtual const char * getMD5() override { return "b81e37d2a31925a0e8ae261a8699cb79"; }; - - }; - -} -#endif diff --git a/pio_workspace/lib/ros_lib/apriltag_ros/AnalyzeSingleImage.h b/pio_workspace/lib/ros_lib/apriltag_ros/AnalyzeSingleImage.h new file mode 100644 index 0000000..32dd80d --- /dev/null +++ b/pio_workspace/lib/ros_lib/apriltag_ros/AnalyzeSingleImage.h @@ -0,0 +1,116 @@ +#ifndef _ROS_SERVICE_AnalyzeSingleImage_h +#define _ROS_SERVICE_AnalyzeSingleImage_h +#include +#include +#include +#include "ros/msg.h" +#include "sensor_msgs/CameraInfo.h" +#include "apriltag_ros/AprilTagDetectionArray.h" + +namespace apriltag_ros +{ + +static const char ANALYZESINGLEIMAGE[] = "apriltag_ros/AnalyzeSingleImage"; + + class AnalyzeSingleImageRequest : public ros::Msg + { + public: + typedef const char* _full_path_where_to_get_image_type; + _full_path_where_to_get_image_type full_path_where_to_get_image; + typedef const char* _full_path_where_to_save_image_type; + _full_path_where_to_save_image_type full_path_where_to_save_image; + typedef sensor_msgs::CameraInfo _camera_info_type; + _camera_info_type camera_info; + + AnalyzeSingleImageRequest(): + full_path_where_to_get_image(""), + full_path_where_to_save_image(""), + camera_info() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_full_path_where_to_get_image = strlen(this->full_path_where_to_get_image); + varToArr(outbuffer + offset, length_full_path_where_to_get_image); + offset += 4; + memcpy(outbuffer + offset, this->full_path_where_to_get_image, length_full_path_where_to_get_image); + offset += length_full_path_where_to_get_image; + uint32_t length_full_path_where_to_save_image = strlen(this->full_path_where_to_save_image); + varToArr(outbuffer + offset, length_full_path_where_to_save_image); + offset += 4; + memcpy(outbuffer + offset, this->full_path_where_to_save_image, length_full_path_where_to_save_image); + offset += length_full_path_where_to_save_image; + offset += this->camera_info.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_full_path_where_to_get_image; + arrToVar(length_full_path_where_to_get_image, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_full_path_where_to_get_image; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_full_path_where_to_get_image-1]=0; + this->full_path_where_to_get_image = (char *)(inbuffer + offset-1); + offset += length_full_path_where_to_get_image; + uint32_t length_full_path_where_to_save_image; + arrToVar(length_full_path_where_to_save_image, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_full_path_where_to_save_image; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_full_path_where_to_save_image-1]=0; + this->full_path_where_to_save_image = (char *)(inbuffer + offset-1); + offset += length_full_path_where_to_save_image; + offset += this->camera_info.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return ANALYZESINGLEIMAGE; }; + virtual const char * getMD5() override { return "ce260db7e8fcb58cbea397e93c5438a4"; }; + + }; + + class AnalyzeSingleImageResponse : public ros::Msg + { + public: + typedef apriltag_ros::AprilTagDetectionArray _tag_detections_type; + _tag_detections_type tag_detections; + + AnalyzeSingleImageResponse(): + tag_detections() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->tag_detections.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->tag_detections.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return ANALYZESINGLEIMAGE; }; + virtual const char * getMD5() override { return "252b618af4df2baf843a5edd035f3c2c"; }; + + }; + + class AnalyzeSingleImage { + public: + typedef AnalyzeSingleImageRequest Request; + typedef AnalyzeSingleImageResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/apriltag_ros/AprilTagDetection.h b/pio_workspace/lib/ros_lib/apriltag_ros/AprilTagDetection.h new file mode 100644 index 0000000..5982381 --- /dev/null +++ b/pio_workspace/lib/ros_lib/apriltag_ros/AprilTagDetection.h @@ -0,0 +1,113 @@ +#ifndef _ROS_apriltag_ros_AprilTagDetection_h +#define _ROS_apriltag_ros_AprilTagDetection_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/PoseWithCovarianceStamped.h" + +namespace apriltag_ros +{ + + class AprilTagDetection : public ros::Msg + { + public: + uint32_t id_length; + typedef int32_t _id_type; + _id_type st_id; + _id_type * id; + uint32_t size_length; + typedef float _size_type; + _size_type st_size; + _size_type * size; + typedef geometry_msgs::PoseWithCovarianceStamped _pose_type; + _pose_type pose; + + AprilTagDetection(): + id_length(0), st_id(), id(nullptr), + size_length(0), st_size(), size(nullptr), + pose() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->id_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->id_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->id_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->id_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->id_length); + for( uint32_t i = 0; i < id_length; i++){ + union { + int32_t real; + uint32_t base; + } u_idi; + u_idi.real = this->id[i]; + *(outbuffer + offset + 0) = (u_idi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_idi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_idi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_idi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->id[i]); + } + *(outbuffer + offset + 0) = (this->size_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->size_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->size_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->size_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->size_length); + for( uint32_t i = 0; i < size_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->size[i]); + } + offset += this->pose.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t id_lengthT = ((uint32_t) (*(inbuffer + offset))); + id_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + id_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + id_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->id_length); + if(id_lengthT > id_length) + this->id = (int32_t*)realloc(this->id, id_lengthT * sizeof(int32_t)); + id_length = id_lengthT; + for( uint32_t i = 0; i < id_length; i++){ + union { + int32_t real; + uint32_t base; + } u_st_id; + u_st_id.base = 0; + u_st_id.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_id.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_id.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_id.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_id = u_st_id.real; + offset += sizeof(this->st_id); + memcpy( &(this->id[i]), &(this->st_id), sizeof(int32_t)); + } + uint32_t size_lengthT = ((uint32_t) (*(inbuffer + offset))); + size_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + size_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + size_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->size_length); + if(size_lengthT > size_length) + this->size = (float*)realloc(this->size, size_lengthT * sizeof(float)); + size_length = size_lengthT; + for( uint32_t i = 0; i < size_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_size)); + memcpy( &(this->size[i]), &(this->st_size), sizeof(float)); + } + offset += this->pose.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "apriltag_ros/AprilTagDetection"; }; + virtual const char * getMD5() override { return "090173a6e2b6c8fd96ce000fe9378b4e"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/apriltag_ros/AprilTagDetectionArray.h b/pio_workspace/lib/ros_lib/apriltag_ros/AprilTagDetectionArray.h new file mode 100644 index 0000000..6568119 --- /dev/null +++ b/pio_workspace/lib/ros_lib/apriltag_ros/AprilTagDetectionArray.h @@ -0,0 +1,70 @@ +#ifndef _ROS_apriltag_ros_AprilTagDetectionArray_h +#define _ROS_apriltag_ros_AprilTagDetectionArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "apriltag_ros/AprilTagDetection.h" + +namespace apriltag_ros +{ + + class AprilTagDetectionArray : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t detections_length; + typedef apriltag_ros::AprilTagDetection _detections_type; + _detections_type st_detections; + _detections_type * detections; + + AprilTagDetectionArray(): + header(), + detections_length(0), st_detections(), detections(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->detections_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->detections_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->detections_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->detections_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->detections_length); + for( uint32_t i = 0; i < detections_length; i++){ + offset += this->detections[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t detections_lengthT = ((uint32_t) (*(inbuffer + offset))); + detections_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + detections_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + detections_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->detections_length); + if(detections_lengthT > detections_length) + this->detections = (apriltag_ros::AprilTagDetection*)realloc(this->detections, detections_lengthT * sizeof(apriltag_ros::AprilTagDetection)); + detections_length = detections_lengthT; + for( uint32_t i = 0; i < detections_length; i++){ + offset += this->st_detections.deserialize(inbuffer + offset); + memcpy( &(this->detections[i]), &(this->st_detections), sizeof(apriltag_ros::AprilTagDetection)); + } + return offset; + } + + virtual const char * getType() override { return "apriltag_ros/AprilTagDetectionArray"; }; + virtual const char * getMD5() override { return "2b6c03434883a5c9897c13b5594dbd91"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/auv_msgs/ThrusterForces.h b/pio_workspace/lib/ros_lib/auv_msgs/ThrusterForces.h index 0584f6e..de53abf 100644 --- a/pio_workspace/lib/ros_lib/auv_msgs/ThrusterForces.h +++ b/pio_workspace/lib/ros_lib/auv_msgs/ThrusterForces.h @@ -12,65 +12,65 @@ namespace auv_msgs class ThrusterForces : public ros::Msg { public: - typedef float _BACK_LEFT_type; - _BACK_LEFT_type BACK_LEFT; - typedef float _HEAVE_BACK_LEFT_type; - _HEAVE_BACK_LEFT_type HEAVE_BACK_LEFT; - typedef float _HEAVE_FRONT_LEFT_type; - _HEAVE_FRONT_LEFT_type HEAVE_FRONT_LEFT; - typedef float _FRONT_LEFT_type; - _FRONT_LEFT_type FRONT_LEFT; - typedef float _FRONT_RIGHT_type; - _FRONT_RIGHT_type FRONT_RIGHT; - typedef float _HEAVE_FRONT_RIGHT_type; - _HEAVE_FRONT_RIGHT_type HEAVE_FRONT_RIGHT; - typedef float _HEAVE_BACK_RIGHT_type; - _HEAVE_BACK_RIGHT_type HEAVE_BACK_RIGHT; - typedef float _BACK_RIGHT_type; - _BACK_RIGHT_type BACK_RIGHT; + typedef float _front_left_type; + _front_left_type front_left; + typedef float _back_left_type; + _back_left_type back_left; + typedef float _heave_back_left_type; + _heave_back_left_type heave_back_left; + typedef float _heave_front_left_type; + _heave_front_left_type heave_front_left; + typedef float _front_right_type; + _front_right_type front_right; + typedef float _heave_front_right_type; + _heave_front_right_type heave_front_right; + typedef float _back_right_type; + _back_right_type back_right; + typedef float _heave_back_right_type; + _heave_back_right_type heave_back_right; ThrusterForces(): - BACK_LEFT(0), - HEAVE_BACK_LEFT(0), - HEAVE_FRONT_LEFT(0), - FRONT_LEFT(0), - FRONT_RIGHT(0), - HEAVE_FRONT_RIGHT(0), - HEAVE_BACK_RIGHT(0), - BACK_RIGHT(0) + front_left(0), + back_left(0), + heave_back_left(0), + heave_front_left(0), + front_right(0), + heave_front_right(0), + back_right(0), + heave_back_right(0) { } virtual int serialize(unsigned char *outbuffer) const override { int offset = 0; - offset += serializeAvrFloat64(outbuffer + offset, this->BACK_LEFT); - offset += serializeAvrFloat64(outbuffer + offset, this->HEAVE_BACK_LEFT); - offset += serializeAvrFloat64(outbuffer + offset, this->HEAVE_FRONT_LEFT); - offset += serializeAvrFloat64(outbuffer + offset, this->FRONT_LEFT); - offset += serializeAvrFloat64(outbuffer + offset, this->FRONT_RIGHT); - offset += serializeAvrFloat64(outbuffer + offset, this->HEAVE_FRONT_RIGHT); - offset += serializeAvrFloat64(outbuffer + offset, this->HEAVE_BACK_RIGHT); - offset += serializeAvrFloat64(outbuffer + offset, this->BACK_RIGHT); + offset += serializeAvrFloat64(outbuffer + offset, this->front_left); + offset += serializeAvrFloat64(outbuffer + offset, this->back_left); + offset += serializeAvrFloat64(outbuffer + offset, this->heave_back_left); + offset += serializeAvrFloat64(outbuffer + offset, this->heave_front_left); + offset += serializeAvrFloat64(outbuffer + offset, this->front_right); + offset += serializeAvrFloat64(outbuffer + offset, this->heave_front_right); + offset += serializeAvrFloat64(outbuffer + offset, this->back_right); + offset += serializeAvrFloat64(outbuffer + offset, this->heave_back_right); return offset; } virtual int deserialize(unsigned char *inbuffer) override { int offset = 0; - offset += deserializeAvrFloat64(inbuffer + offset, &(this->BACK_LEFT)); - offset += deserializeAvrFloat64(inbuffer + offset, &(this->HEAVE_BACK_LEFT)); - offset += deserializeAvrFloat64(inbuffer + offset, &(this->HEAVE_FRONT_LEFT)); - offset += deserializeAvrFloat64(inbuffer + offset, &(this->FRONT_LEFT)); - offset += deserializeAvrFloat64(inbuffer + offset, &(this->FRONT_RIGHT)); - offset += deserializeAvrFloat64(inbuffer + offset, &(this->HEAVE_FRONT_RIGHT)); - offset += deserializeAvrFloat64(inbuffer + offset, &(this->HEAVE_BACK_RIGHT)); - offset += deserializeAvrFloat64(inbuffer + offset, &(this->BACK_RIGHT)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->front_left)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->back_left)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->heave_back_left)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->heave_front_left)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->front_right)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->heave_front_right)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->back_right)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->heave_back_right)); return offset; } virtual const char * getType() override { return "auv_msgs/ThrusterForces"; }; - virtual const char * getMD5() override { return "3852caff2b3aec4312af1b5ef825391d"; }; + virtual const char * getMD5() override { return "87d1913726f1a30a5009c3771816b687"; }; }; diff --git a/pio_workspace/lib/ros_lib/auv_msgs/ThrusterMicroseconds.h b/pio_workspace/lib/ros_lib/auv_msgs/ThrusterMicroseconds.h index 7478a71..04cdcf3 100644 --- a/pio_workspace/lib/ros_lib/auv_msgs/ThrusterMicroseconds.h +++ b/pio_workspace/lib/ros_lib/auv_msgs/ThrusterMicroseconds.h @@ -13,14 +13,14 @@ namespace auv_msgs { public: uint16_t microseconds[8]; - enum { BACK_LEFT = 0 }; - enum { HEAVE_BACK_LEFT = 1 }; - enum { HEAVE_FRONT_LEFT = 2 }; - enum { FRONT_LEFT = 3 }; - enum { FRONT_RIGHT = 4 }; - enum { HEAVE_FRONT_RIGHT = 5 }; - enum { HEAVE_BACK_RIGHT = 6 }; - enum { BACK_RIGHT = 7 }; + enum { BACK_RIGHT = 0 }; + enum { HEAVE_BACK_RIGHT = 1 }; + enum { HEAVE_FRONT_RIGHT = 2 }; + enum { FRONT_RIGHT = 3 }; + enum { FRONT_LEFT = 4 }; + enum { HEAVE_FRONT_LEFT = 5 }; + enum { HEAVE_BACK_LEFT = 6 }; + enum { BACK_LEFT = 7 }; ThrusterMicroseconds(): microseconds() @@ -50,7 +50,7 @@ namespace auv_msgs } virtual const char * getType() override { return "auv_msgs/ThrusterMicroseconds"; }; - virtual const char * getMD5() override { return "ce83c915b46f480a1b250f5617138b15"; }; + virtual const char * getMD5() override { return "2db5570c89aa1c1490ed49290c97db2c"; }; }; diff --git a/pio_workspace/lib/ros_lib/auv_msgs/UnityState.h b/pio_workspace/lib/ros_lib/auv_msgs/UnityState.h index cb5321b..c27021f 100644 --- a/pio_workspace/lib/ros_lib/auv_msgs/UnityState.h +++ b/pio_workspace/lib/ros_lib/auv_msgs/UnityState.h @@ -28,22 +28,22 @@ namespace auv_msgs typedef int32_t _frequencies_type; _frequencies_type st_frequencies; _frequencies_type * frequencies; - uint32_t times_pinger_1_length; - typedef uint32_t _times_pinger_1_type; - _times_pinger_1_type st_times_pinger_1; - _times_pinger_1_type * times_pinger_1; - uint32_t times_pinger_2_length; - typedef uint32_t _times_pinger_2_type; - _times_pinger_2_type st_times_pinger_2; - _times_pinger_2_type * times_pinger_2; - uint32_t times_pinger_3_length; - typedef uint32_t _times_pinger_3_type; - _times_pinger_3_type st_times_pinger_3; - _times_pinger_3_type * times_pinger_3; - uint32_t times_pinger_4_length; - typedef uint32_t _times_pinger_4_type; - _times_pinger_4_type st_times_pinger_4; - _times_pinger_4_type * times_pinger_4; + uint32_t hydrophone_one_freqs_length; + typedef uint32_t _hydrophone_one_freqs_type; + _hydrophone_one_freqs_type st_hydrophone_one_freqs; + _hydrophone_one_freqs_type * hydrophone_one_freqs; + uint32_t hydrophone_two_freqs_length; + typedef uint32_t _hydrophone_two_freqs_type; + _hydrophone_two_freqs_type st_hydrophone_two_freqs; + _hydrophone_two_freqs_type * hydrophone_two_freqs; + uint32_t hydrophone_three_freqs_length; + typedef uint32_t _hydrophone_three_freqs_type; + _hydrophone_three_freqs_type st_hydrophone_three_freqs; + _hydrophone_three_freqs_type * hydrophone_three_freqs; + uint32_t hydrophone_four_freqs_length; + typedef uint32_t _hydrophone_four_freqs_type; + _hydrophone_four_freqs_type st_hydrophone_four_freqs; + _hydrophone_four_freqs_type * hydrophone_four_freqs; typedef int32_t _isDVLActive_type; _isDVLActive_type isDVLActive; typedef int32_t _isDepthSensorActive_type; @@ -60,10 +60,10 @@ namespace auv_msgs angular_velocity(), linear_acceleration(), frequencies_length(0), st_frequencies(), frequencies(nullptr), - times_pinger_1_length(0), st_times_pinger_1(), times_pinger_1(nullptr), - times_pinger_2_length(0), st_times_pinger_2(), times_pinger_2(nullptr), - times_pinger_3_length(0), st_times_pinger_3(), times_pinger_3(nullptr), - times_pinger_4_length(0), st_times_pinger_4(), times_pinger_4(nullptr), + hydrophone_one_freqs_length(0), st_hydrophone_one_freqs(), hydrophone_one_freqs(nullptr), + hydrophone_two_freqs_length(0), st_hydrophone_two_freqs(), hydrophone_two_freqs(nullptr), + hydrophone_three_freqs_length(0), st_hydrophone_three_freqs(), hydrophone_three_freqs(nullptr), + hydrophone_four_freqs_length(0), st_hydrophone_four_freqs(), hydrophone_four_freqs(nullptr), isDVLActive(0), isDepthSensorActive(0), isIMUActive(0), @@ -96,53 +96,53 @@ namespace auv_msgs *(outbuffer + offset + 3) = (u_frequenciesi.base >> (8 * 3)) & 0xFF; offset += sizeof(this->frequencies[i]); } - *(outbuffer + offset + 0) = (this->times_pinger_1_length >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (this->times_pinger_1_length >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (this->times_pinger_1_length >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (this->times_pinger_1_length >> (8 * 3)) & 0xFF; - offset += sizeof(this->times_pinger_1_length); - for( uint32_t i = 0; i < times_pinger_1_length; i++){ - *(outbuffer + offset + 0) = (this->times_pinger_1[i] >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (this->times_pinger_1[i] >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (this->times_pinger_1[i] >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (this->times_pinger_1[i] >> (8 * 3)) & 0xFF; - offset += sizeof(this->times_pinger_1[i]); + *(outbuffer + offset + 0) = (this->hydrophone_one_freqs_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->hydrophone_one_freqs_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->hydrophone_one_freqs_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->hydrophone_one_freqs_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->hydrophone_one_freqs_length); + for( uint32_t i = 0; i < hydrophone_one_freqs_length; i++){ + *(outbuffer + offset + 0) = (this->hydrophone_one_freqs[i] >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->hydrophone_one_freqs[i] >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->hydrophone_one_freqs[i] >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->hydrophone_one_freqs[i] >> (8 * 3)) & 0xFF; + offset += sizeof(this->hydrophone_one_freqs[i]); } - *(outbuffer + offset + 0) = (this->times_pinger_2_length >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (this->times_pinger_2_length >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (this->times_pinger_2_length >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (this->times_pinger_2_length >> (8 * 3)) & 0xFF; - offset += sizeof(this->times_pinger_2_length); - for( uint32_t i = 0; i < times_pinger_2_length; i++){ - *(outbuffer + offset + 0) = (this->times_pinger_2[i] >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (this->times_pinger_2[i] >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (this->times_pinger_2[i] >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (this->times_pinger_2[i] >> (8 * 3)) & 0xFF; - offset += sizeof(this->times_pinger_2[i]); + *(outbuffer + offset + 0) = (this->hydrophone_two_freqs_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->hydrophone_two_freqs_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->hydrophone_two_freqs_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->hydrophone_two_freqs_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->hydrophone_two_freqs_length); + for( uint32_t i = 0; i < hydrophone_two_freqs_length; i++){ + *(outbuffer + offset + 0) = (this->hydrophone_two_freqs[i] >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->hydrophone_two_freqs[i] >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->hydrophone_two_freqs[i] >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->hydrophone_two_freqs[i] >> (8 * 3)) & 0xFF; + offset += sizeof(this->hydrophone_two_freqs[i]); } - *(outbuffer + offset + 0) = (this->times_pinger_3_length >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (this->times_pinger_3_length >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (this->times_pinger_3_length >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (this->times_pinger_3_length >> (8 * 3)) & 0xFF; - offset += sizeof(this->times_pinger_3_length); - for( uint32_t i = 0; i < times_pinger_3_length; i++){ - *(outbuffer + offset + 0) = (this->times_pinger_3[i] >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (this->times_pinger_3[i] >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (this->times_pinger_3[i] >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (this->times_pinger_3[i] >> (8 * 3)) & 0xFF; - offset += sizeof(this->times_pinger_3[i]); + *(outbuffer + offset + 0) = (this->hydrophone_three_freqs_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->hydrophone_three_freqs_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->hydrophone_three_freqs_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->hydrophone_three_freqs_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->hydrophone_three_freqs_length); + for( uint32_t i = 0; i < hydrophone_three_freqs_length; i++){ + *(outbuffer + offset + 0) = (this->hydrophone_three_freqs[i] >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->hydrophone_three_freqs[i] >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->hydrophone_three_freqs[i] >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->hydrophone_three_freqs[i] >> (8 * 3)) & 0xFF; + offset += sizeof(this->hydrophone_three_freqs[i]); } - *(outbuffer + offset + 0) = (this->times_pinger_4_length >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (this->times_pinger_4_length >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (this->times_pinger_4_length >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (this->times_pinger_4_length >> (8 * 3)) & 0xFF; - offset += sizeof(this->times_pinger_4_length); - for( uint32_t i = 0; i < times_pinger_4_length; i++){ - *(outbuffer + offset + 0) = (this->times_pinger_4[i] >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (this->times_pinger_4[i] >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (this->times_pinger_4[i] >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (this->times_pinger_4[i] >> (8 * 3)) & 0xFF; - offset += sizeof(this->times_pinger_4[i]); + *(outbuffer + offset + 0) = (this->hydrophone_four_freqs_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->hydrophone_four_freqs_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->hydrophone_four_freqs_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->hydrophone_four_freqs_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->hydrophone_four_freqs_length); + for( uint32_t i = 0; i < hydrophone_four_freqs_length; i++){ + *(outbuffer + offset + 0) = (this->hydrophone_four_freqs[i] >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->hydrophone_four_freqs[i] >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->hydrophone_four_freqs[i] >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->hydrophone_four_freqs[i] >> (8 * 3)) & 0xFF; + offset += sizeof(this->hydrophone_four_freqs[i]); } union { int32_t real; @@ -217,69 +217,69 @@ namespace auv_msgs offset += sizeof(this->st_frequencies); memcpy( &(this->frequencies[i]), &(this->st_frequencies), sizeof(int32_t)); } - uint32_t times_pinger_1_lengthT = ((uint32_t) (*(inbuffer + offset))); - times_pinger_1_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - times_pinger_1_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - times_pinger_1_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - offset += sizeof(this->times_pinger_1_length); - if(times_pinger_1_lengthT > times_pinger_1_length) - this->times_pinger_1 = (uint32_t*)realloc(this->times_pinger_1, times_pinger_1_lengthT * sizeof(uint32_t)); - times_pinger_1_length = times_pinger_1_lengthT; - for( uint32_t i = 0; i < times_pinger_1_length; i++){ - this->st_times_pinger_1 = ((uint32_t) (*(inbuffer + offset))); - this->st_times_pinger_1 |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - this->st_times_pinger_1 |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - this->st_times_pinger_1 |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - offset += sizeof(this->st_times_pinger_1); - memcpy( &(this->times_pinger_1[i]), &(this->st_times_pinger_1), sizeof(uint32_t)); + uint32_t hydrophone_one_freqs_lengthT = ((uint32_t) (*(inbuffer + offset))); + hydrophone_one_freqs_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + hydrophone_one_freqs_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + hydrophone_one_freqs_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->hydrophone_one_freqs_length); + if(hydrophone_one_freqs_lengthT > hydrophone_one_freqs_length) + this->hydrophone_one_freqs = (uint32_t*)realloc(this->hydrophone_one_freqs, hydrophone_one_freqs_lengthT * sizeof(uint32_t)); + hydrophone_one_freqs_length = hydrophone_one_freqs_lengthT; + for( uint32_t i = 0; i < hydrophone_one_freqs_length; i++){ + this->st_hydrophone_one_freqs = ((uint32_t) (*(inbuffer + offset))); + this->st_hydrophone_one_freqs |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->st_hydrophone_one_freqs |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->st_hydrophone_one_freqs |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->st_hydrophone_one_freqs); + memcpy( &(this->hydrophone_one_freqs[i]), &(this->st_hydrophone_one_freqs), sizeof(uint32_t)); } - uint32_t times_pinger_2_lengthT = ((uint32_t) (*(inbuffer + offset))); - times_pinger_2_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - times_pinger_2_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - times_pinger_2_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - offset += sizeof(this->times_pinger_2_length); - if(times_pinger_2_lengthT > times_pinger_2_length) - this->times_pinger_2 = (uint32_t*)realloc(this->times_pinger_2, times_pinger_2_lengthT * sizeof(uint32_t)); - times_pinger_2_length = times_pinger_2_lengthT; - for( uint32_t i = 0; i < times_pinger_2_length; i++){ - this->st_times_pinger_2 = ((uint32_t) (*(inbuffer + offset))); - this->st_times_pinger_2 |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - this->st_times_pinger_2 |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - this->st_times_pinger_2 |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - offset += sizeof(this->st_times_pinger_2); - memcpy( &(this->times_pinger_2[i]), &(this->st_times_pinger_2), sizeof(uint32_t)); + uint32_t hydrophone_two_freqs_lengthT = ((uint32_t) (*(inbuffer + offset))); + hydrophone_two_freqs_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + hydrophone_two_freqs_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + hydrophone_two_freqs_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->hydrophone_two_freqs_length); + if(hydrophone_two_freqs_lengthT > hydrophone_two_freqs_length) + this->hydrophone_two_freqs = (uint32_t*)realloc(this->hydrophone_two_freqs, hydrophone_two_freqs_lengthT * sizeof(uint32_t)); + hydrophone_two_freqs_length = hydrophone_two_freqs_lengthT; + for( uint32_t i = 0; i < hydrophone_two_freqs_length; i++){ + this->st_hydrophone_two_freqs = ((uint32_t) (*(inbuffer + offset))); + this->st_hydrophone_two_freqs |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->st_hydrophone_two_freqs |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->st_hydrophone_two_freqs |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->st_hydrophone_two_freqs); + memcpy( &(this->hydrophone_two_freqs[i]), &(this->st_hydrophone_two_freqs), sizeof(uint32_t)); } - uint32_t times_pinger_3_lengthT = ((uint32_t) (*(inbuffer + offset))); - times_pinger_3_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - times_pinger_3_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - times_pinger_3_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - offset += sizeof(this->times_pinger_3_length); - if(times_pinger_3_lengthT > times_pinger_3_length) - this->times_pinger_3 = (uint32_t*)realloc(this->times_pinger_3, times_pinger_3_lengthT * sizeof(uint32_t)); - times_pinger_3_length = times_pinger_3_lengthT; - for( uint32_t i = 0; i < times_pinger_3_length; i++){ - this->st_times_pinger_3 = ((uint32_t) (*(inbuffer + offset))); - this->st_times_pinger_3 |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - this->st_times_pinger_3 |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - this->st_times_pinger_3 |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - offset += sizeof(this->st_times_pinger_3); - memcpy( &(this->times_pinger_3[i]), &(this->st_times_pinger_3), sizeof(uint32_t)); + uint32_t hydrophone_three_freqs_lengthT = ((uint32_t) (*(inbuffer + offset))); + hydrophone_three_freqs_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + hydrophone_three_freqs_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + hydrophone_three_freqs_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->hydrophone_three_freqs_length); + if(hydrophone_three_freqs_lengthT > hydrophone_three_freqs_length) + this->hydrophone_three_freqs = (uint32_t*)realloc(this->hydrophone_three_freqs, hydrophone_three_freqs_lengthT * sizeof(uint32_t)); + hydrophone_three_freqs_length = hydrophone_three_freqs_lengthT; + for( uint32_t i = 0; i < hydrophone_three_freqs_length; i++){ + this->st_hydrophone_three_freqs = ((uint32_t) (*(inbuffer + offset))); + this->st_hydrophone_three_freqs |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->st_hydrophone_three_freqs |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->st_hydrophone_three_freqs |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->st_hydrophone_three_freqs); + memcpy( &(this->hydrophone_three_freqs[i]), &(this->st_hydrophone_three_freqs), sizeof(uint32_t)); } - uint32_t times_pinger_4_lengthT = ((uint32_t) (*(inbuffer + offset))); - times_pinger_4_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - times_pinger_4_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - times_pinger_4_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - offset += sizeof(this->times_pinger_4_length); - if(times_pinger_4_lengthT > times_pinger_4_length) - this->times_pinger_4 = (uint32_t*)realloc(this->times_pinger_4, times_pinger_4_lengthT * sizeof(uint32_t)); - times_pinger_4_length = times_pinger_4_lengthT; - for( uint32_t i = 0; i < times_pinger_4_length; i++){ - this->st_times_pinger_4 = ((uint32_t) (*(inbuffer + offset))); - this->st_times_pinger_4 |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - this->st_times_pinger_4 |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - this->st_times_pinger_4 |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - offset += sizeof(this->st_times_pinger_4); - memcpy( &(this->times_pinger_4[i]), &(this->st_times_pinger_4), sizeof(uint32_t)); + uint32_t hydrophone_four_freqs_lengthT = ((uint32_t) (*(inbuffer + offset))); + hydrophone_four_freqs_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + hydrophone_four_freqs_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + hydrophone_four_freqs_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->hydrophone_four_freqs_length); + if(hydrophone_four_freqs_lengthT > hydrophone_four_freqs_length) + this->hydrophone_four_freqs = (uint32_t*)realloc(this->hydrophone_four_freqs, hydrophone_four_freqs_lengthT * sizeof(uint32_t)); + hydrophone_four_freqs_length = hydrophone_four_freqs_lengthT; + for( uint32_t i = 0; i < hydrophone_four_freqs_length; i++){ + this->st_hydrophone_four_freqs = ((uint32_t) (*(inbuffer + offset))); + this->st_hydrophone_four_freqs |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->st_hydrophone_four_freqs |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->st_hydrophone_four_freqs |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->st_hydrophone_four_freqs); + memcpy( &(this->hydrophone_four_freqs[i]), &(this->st_hydrophone_four_freqs), sizeof(uint32_t)); } union { int32_t real; @@ -329,7 +329,7 @@ namespace auv_msgs } virtual const char * getType() override { return "auv_msgs/UnityState"; }; - virtual const char * getMD5() override { return "eafbb66a66e394412e0b607bd4a7ddd3"; }; + virtual const char * getMD5() override { return "deac3cf7620639c22bbe228fb39d2aa6"; }; }; diff --git a/pio_workspace/lib/ros_lib/base_local_planner/Position2DInt.h b/pio_workspace/lib/ros_lib/base_local_planner/Position2DInt.h new file mode 100644 index 0000000..8050455 --- /dev/null +++ b/pio_workspace/lib/ros_lib/base_local_planner/Position2DInt.h @@ -0,0 +1,102 @@ +#ifndef _ROS_base_local_planner_Position2DInt_h +#define _ROS_base_local_planner_Position2DInt_h + +#include +#include +#include +#include "ros/msg.h" + +namespace base_local_planner +{ + + class Position2DInt : public ros::Msg + { + public: + typedef int64_t _x_type; + _x_type x; + typedef int64_t _y_type; + _y_type y; + + Position2DInt(): + x(0), + y(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + int64_t real; + uint64_t base; + } u_x; + u_x.real = this->x; + *(outbuffer + offset + 0) = (u_x.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_x.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_x.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_x.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_x.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_x.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_x.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_x.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->x); + union { + int64_t real; + uint64_t base; + } u_y; + u_y.real = this->y; + *(outbuffer + offset + 0) = (u_y.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_y.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_y.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_y.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_y.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_y.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_y.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_y.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->y); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + int64_t real; + uint64_t base; + } u_x; + u_x.base = 0; + u_x.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_x.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_x.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_x.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_x.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_x.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_x.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_x.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->x = u_x.real; + offset += sizeof(this->x); + union { + int64_t real; + uint64_t base; + } u_y; + u_y.base = 0; + u_y.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_y.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_y.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_y.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_y.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_y.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_y.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_y.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->y = u_y.real; + offset += sizeof(this->y); + return offset; + } + + virtual const char * getType() override { return "base_local_planner/Position2DInt"; }; + virtual const char * getMD5() override { return "3b834ede922a0fff22c43585c533b49f"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/control_toolbox/SetPidGains.h b/pio_workspace/lib/ros_lib/control_toolbox/SetPidGains.h deleted file mode 100644 index a31a09b..0000000 --- a/pio_workspace/lib/ros_lib/control_toolbox/SetPidGains.h +++ /dev/null @@ -1,108 +0,0 @@ -#ifndef _ROS_SERVICE_SetPidGains_h -#define _ROS_SERVICE_SetPidGains_h -#include -#include -#include -#include "ros/msg.h" - -namespace control_toolbox -{ - -static const char SETPIDGAINS[] = "control_toolbox/SetPidGains"; - - class SetPidGainsRequest : public ros::Msg - { - public: - typedef float _p_type; - _p_type p; - typedef float _i_type; - _i_type i; - typedef float _d_type; - _d_type d; - typedef float _i_clamp_type; - _i_clamp_type i_clamp; - typedef bool _antiwindup_type; - _antiwindup_type antiwindup; - - SetPidGainsRequest(): - p(0), - i(0), - d(0), - i_clamp(0), - antiwindup(0) - { - } - - virtual int serialize(unsigned char *outbuffer) const override - { - int offset = 0; - offset += serializeAvrFloat64(outbuffer + offset, this->p); - offset += serializeAvrFloat64(outbuffer + offset, this->i); - offset += serializeAvrFloat64(outbuffer + offset, this->d); - offset += serializeAvrFloat64(outbuffer + offset, this->i_clamp); - union { - bool real; - uint8_t base; - } u_antiwindup; - u_antiwindup.real = this->antiwindup; - *(outbuffer + offset + 0) = (u_antiwindup.base >> (8 * 0)) & 0xFF; - offset += sizeof(this->antiwindup); - return offset; - } - - virtual int deserialize(unsigned char *inbuffer) override - { - int offset = 0; - offset += deserializeAvrFloat64(inbuffer + offset, &(this->p)); - offset += deserializeAvrFloat64(inbuffer + offset, &(this->i)); - offset += deserializeAvrFloat64(inbuffer + offset, &(this->d)); - offset += deserializeAvrFloat64(inbuffer + offset, &(this->i_clamp)); - union { - bool real; - uint8_t base; - } u_antiwindup; - u_antiwindup.base = 0; - u_antiwindup.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); - this->antiwindup = u_antiwindup.real; - offset += sizeof(this->antiwindup); - return offset; - } - - virtual const char * getType() override { return SETPIDGAINS; }; - virtual const char * getMD5() override { return "4a43159879643e60937bf2893b633607"; }; - - }; - - class SetPidGainsResponse : public ros::Msg - { - public: - - SetPidGainsResponse() - { - } - - virtual int serialize(unsigned char *outbuffer) const override - { - int offset = 0; - return offset; - } - - virtual int deserialize(unsigned char *inbuffer) override - { - int offset = 0; - return offset; - } - - virtual const char * getType() override { return SETPIDGAINS; }; - virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; - - }; - - class SetPidGains { - public: - typedef SetPidGainsRequest Request; - typedef SetPidGainsResponse Response; - }; - -} -#endif diff --git a/pio_workspace/lib/ros_lib/controller_manager_msgs/ControllerState.h b/pio_workspace/lib/ros_lib/controller_manager_msgs/ControllerState.h deleted file mode 100644 index edcd0fa..0000000 --- a/pio_workspace/lib/ros_lib/controller_manager_msgs/ControllerState.h +++ /dev/null @@ -1,115 +0,0 @@ -#ifndef _ROS_controller_manager_msgs_ControllerState_h -#define _ROS_controller_manager_msgs_ControllerState_h - -#include -#include -#include -#include "ros/msg.h" -#include "controller_manager_msgs/HardwareInterfaceResources.h" - -namespace controller_manager_msgs -{ - - class ControllerState : public ros::Msg - { - public: - typedef const char* _name_type; - _name_type name; - typedef const char* _state_type; - _state_type state; - typedef const char* _type_type; - _type_type type; - uint32_t claimed_resources_length; - typedef controller_manager_msgs::HardwareInterfaceResources _claimed_resources_type; - _claimed_resources_type st_claimed_resources; - _claimed_resources_type * claimed_resources; - - ControllerState(): - name(""), - state(""), - type(""), - claimed_resources_length(0), st_claimed_resources(), claimed_resources(nullptr) - { - } - - virtual int serialize(unsigned char *outbuffer) const override - { - int offset = 0; - uint32_t length_name = strlen(this->name); - varToArr(outbuffer + offset, length_name); - offset += 4; - memcpy(outbuffer + offset, this->name, length_name); - offset += length_name; - uint32_t length_state = strlen(this->state); - varToArr(outbuffer + offset, length_state); - offset += 4; - memcpy(outbuffer + offset, this->state, length_state); - offset += length_state; - uint32_t length_type = strlen(this->type); - varToArr(outbuffer + offset, length_type); - offset += 4; - memcpy(outbuffer + offset, this->type, length_type); - offset += length_type; - *(outbuffer + offset + 0) = (this->claimed_resources_length >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (this->claimed_resources_length >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (this->claimed_resources_length >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (this->claimed_resources_length >> (8 * 3)) & 0xFF; - offset += sizeof(this->claimed_resources_length); - for( uint32_t i = 0; i < claimed_resources_length; i++){ - offset += this->claimed_resources[i].serialize(outbuffer + offset); - } - return offset; - } - - virtual int deserialize(unsigned char *inbuffer) override - { - int offset = 0; - uint32_t length_name; - arrToVar(length_name, (inbuffer + offset)); - offset += 4; - for(unsigned int k= offset; k< offset+length_name; ++k){ - inbuffer[k-1]=inbuffer[k]; - } - inbuffer[offset+length_name-1]=0; - this->name = (char *)(inbuffer + offset-1); - offset += length_name; - uint32_t length_state; - arrToVar(length_state, (inbuffer + offset)); - offset += 4; - for(unsigned int k= offset; k< offset+length_state; ++k){ - inbuffer[k-1]=inbuffer[k]; - } - inbuffer[offset+length_state-1]=0; - this->state = (char *)(inbuffer + offset-1); - offset += length_state; - uint32_t length_type; - arrToVar(length_type, (inbuffer + offset)); - offset += 4; - for(unsigned int k= offset; k< offset+length_type; ++k){ - inbuffer[k-1]=inbuffer[k]; - } - inbuffer[offset+length_type-1]=0; - this->type = (char *)(inbuffer + offset-1); - offset += length_type; - uint32_t claimed_resources_lengthT = ((uint32_t) (*(inbuffer + offset))); - claimed_resources_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - claimed_resources_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - claimed_resources_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - offset += sizeof(this->claimed_resources_length); - if(claimed_resources_lengthT > claimed_resources_length) - this->claimed_resources = (controller_manager_msgs::HardwareInterfaceResources*)realloc(this->claimed_resources, claimed_resources_lengthT * sizeof(controller_manager_msgs::HardwareInterfaceResources)); - claimed_resources_length = claimed_resources_lengthT; - for( uint32_t i = 0; i < claimed_resources_length; i++){ - offset += this->st_claimed_resources.deserialize(inbuffer + offset); - memcpy( &(this->claimed_resources[i]), &(this->st_claimed_resources), sizeof(controller_manager_msgs::HardwareInterfaceResources)); - } - return offset; - } - - virtual const char * getType() override { return "controller_manager_msgs/ControllerState"; }; - virtual const char * getMD5() override { return "aeb6b261d97793ab74099a3740245272"; }; - - }; - -} -#endif diff --git a/pio_workspace/lib/ros_lib/controller_manager_msgs/ControllerStatistics.h b/pio_workspace/lib/ros_lib/controller_manager_msgs/ControllerStatistics.h deleted file mode 100644 index 66c7227..0000000 --- a/pio_workspace/lib/ros_lib/controller_manager_msgs/ControllerStatistics.h +++ /dev/null @@ -1,231 +0,0 @@ -#ifndef _ROS_controller_manager_msgs_ControllerStatistics_h -#define _ROS_controller_manager_msgs_ControllerStatistics_h - -#include -#include -#include -#include "ros/msg.h" -#include "ros/time.h" -#include "ros/duration.h" - -namespace controller_manager_msgs -{ - - class ControllerStatistics : public ros::Msg - { - public: - typedef const char* _name_type; - _name_type name; - typedef const char* _type_type; - _type_type type; - typedef ros::Time _timestamp_type; - _timestamp_type timestamp; - typedef bool _running_type; - _running_type running; - typedef ros::Duration _max_time_type; - _max_time_type max_time; - typedef ros::Duration _mean_time_type; - _mean_time_type mean_time; - typedef ros::Duration _variance_time_type; - _variance_time_type variance_time; - typedef int32_t _num_control_loop_overruns_type; - _num_control_loop_overruns_type num_control_loop_overruns; - typedef ros::Time _time_last_control_loop_overrun_type; - _time_last_control_loop_overrun_type time_last_control_loop_overrun; - - ControllerStatistics(): - name(""), - type(""), - timestamp(), - running(0), - max_time(), - mean_time(), - variance_time(), - num_control_loop_overruns(0), - time_last_control_loop_overrun() - { - } - - virtual int serialize(unsigned char *outbuffer) const override - { - int offset = 0; - uint32_t length_name = strlen(this->name); - varToArr(outbuffer + offset, length_name); - offset += 4; - memcpy(outbuffer + offset, this->name, length_name); - offset += length_name; - uint32_t length_type = strlen(this->type); - varToArr(outbuffer + offset, length_type); - offset += 4; - memcpy(outbuffer + offset, this->type, length_type); - offset += length_type; - *(outbuffer + offset + 0) = (this->timestamp.sec >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (this->timestamp.sec >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (this->timestamp.sec >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (this->timestamp.sec >> (8 * 3)) & 0xFF; - offset += sizeof(this->timestamp.sec); - *(outbuffer + offset + 0) = (this->timestamp.nsec >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (this->timestamp.nsec >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (this->timestamp.nsec >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (this->timestamp.nsec >> (8 * 3)) & 0xFF; - offset += sizeof(this->timestamp.nsec); - union { - bool real; - uint8_t base; - } u_running; - u_running.real = this->running; - *(outbuffer + offset + 0) = (u_running.base >> (8 * 0)) & 0xFF; - offset += sizeof(this->running); - *(outbuffer + offset + 0) = (this->max_time.sec >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (this->max_time.sec >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (this->max_time.sec >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (this->max_time.sec >> (8 * 3)) & 0xFF; - offset += sizeof(this->max_time.sec); - *(outbuffer + offset + 0) = (this->max_time.nsec >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (this->max_time.nsec >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (this->max_time.nsec >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (this->max_time.nsec >> (8 * 3)) & 0xFF; - offset += sizeof(this->max_time.nsec); - *(outbuffer + offset + 0) = (this->mean_time.sec >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (this->mean_time.sec >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (this->mean_time.sec >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (this->mean_time.sec >> (8 * 3)) & 0xFF; - offset += sizeof(this->mean_time.sec); - *(outbuffer + offset + 0) = (this->mean_time.nsec >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (this->mean_time.nsec >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (this->mean_time.nsec >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (this->mean_time.nsec >> (8 * 3)) & 0xFF; - offset += sizeof(this->mean_time.nsec); - *(outbuffer + offset + 0) = (this->variance_time.sec >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (this->variance_time.sec >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (this->variance_time.sec >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (this->variance_time.sec >> (8 * 3)) & 0xFF; - offset += sizeof(this->variance_time.sec); - *(outbuffer + offset + 0) = (this->variance_time.nsec >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (this->variance_time.nsec >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (this->variance_time.nsec >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (this->variance_time.nsec >> (8 * 3)) & 0xFF; - offset += sizeof(this->variance_time.nsec); - union { - int32_t real; - uint32_t base; - } u_num_control_loop_overruns; - u_num_control_loop_overruns.real = this->num_control_loop_overruns; - *(outbuffer + offset + 0) = (u_num_control_loop_overruns.base >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (u_num_control_loop_overruns.base >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (u_num_control_loop_overruns.base >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (u_num_control_loop_overruns.base >> (8 * 3)) & 0xFF; - offset += sizeof(this->num_control_loop_overruns); - *(outbuffer + offset + 0) = (this->time_last_control_loop_overrun.sec >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (this->time_last_control_loop_overrun.sec >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (this->time_last_control_loop_overrun.sec >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (this->time_last_control_loop_overrun.sec >> (8 * 3)) & 0xFF; - offset += sizeof(this->time_last_control_loop_overrun.sec); - *(outbuffer + offset + 0) = (this->time_last_control_loop_overrun.nsec >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (this->time_last_control_loop_overrun.nsec >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (this->time_last_control_loop_overrun.nsec >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (this->time_last_control_loop_overrun.nsec >> (8 * 3)) & 0xFF; - offset += sizeof(this->time_last_control_loop_overrun.nsec); - return offset; - } - - virtual int deserialize(unsigned char *inbuffer) override - { - int offset = 0; - uint32_t length_name; - arrToVar(length_name, (inbuffer + offset)); - offset += 4; - for(unsigned int k= offset; k< offset+length_name; ++k){ - inbuffer[k-1]=inbuffer[k]; - } - inbuffer[offset+length_name-1]=0; - this->name = (char *)(inbuffer + offset-1); - offset += length_name; - uint32_t length_type; - arrToVar(length_type, (inbuffer + offset)); - offset += 4; - for(unsigned int k= offset; k< offset+length_type; ++k){ - inbuffer[k-1]=inbuffer[k]; - } - inbuffer[offset+length_type-1]=0; - this->type = (char *)(inbuffer + offset-1); - offset += length_type; - this->timestamp.sec = ((uint32_t) (*(inbuffer + offset))); - this->timestamp.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - this->timestamp.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - this->timestamp.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - offset += sizeof(this->timestamp.sec); - this->timestamp.nsec = ((uint32_t) (*(inbuffer + offset))); - this->timestamp.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - this->timestamp.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - this->timestamp.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - offset += sizeof(this->timestamp.nsec); - union { - bool real; - uint8_t base; - } u_running; - u_running.base = 0; - u_running.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); - this->running = u_running.real; - offset += sizeof(this->running); - this->max_time.sec = ((uint32_t) (*(inbuffer + offset))); - this->max_time.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - this->max_time.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - this->max_time.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - offset += sizeof(this->max_time.sec); - this->max_time.nsec = ((uint32_t) (*(inbuffer + offset))); - this->max_time.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - this->max_time.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - this->max_time.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - offset += sizeof(this->max_time.nsec); - this->mean_time.sec = ((uint32_t) (*(inbuffer + offset))); - this->mean_time.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - this->mean_time.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - this->mean_time.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - offset += sizeof(this->mean_time.sec); - this->mean_time.nsec = ((uint32_t) (*(inbuffer + offset))); - this->mean_time.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - this->mean_time.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - this->mean_time.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - offset += sizeof(this->mean_time.nsec); - this->variance_time.sec = ((uint32_t) (*(inbuffer + offset))); - this->variance_time.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - this->variance_time.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - this->variance_time.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - offset += sizeof(this->variance_time.sec); - this->variance_time.nsec = ((uint32_t) (*(inbuffer + offset))); - this->variance_time.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - this->variance_time.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - this->variance_time.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - offset += sizeof(this->variance_time.nsec); - union { - int32_t real; - uint32_t base; - } u_num_control_loop_overruns; - u_num_control_loop_overruns.base = 0; - u_num_control_loop_overruns.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); - u_num_control_loop_overruns.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - u_num_control_loop_overruns.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - u_num_control_loop_overruns.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - this->num_control_loop_overruns = u_num_control_loop_overruns.real; - offset += sizeof(this->num_control_loop_overruns); - this->time_last_control_loop_overrun.sec = ((uint32_t) (*(inbuffer + offset))); - this->time_last_control_loop_overrun.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - this->time_last_control_loop_overrun.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - this->time_last_control_loop_overrun.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - offset += sizeof(this->time_last_control_loop_overrun.sec); - this->time_last_control_loop_overrun.nsec = ((uint32_t) (*(inbuffer + offset))); - this->time_last_control_loop_overrun.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - this->time_last_control_loop_overrun.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - this->time_last_control_loop_overrun.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - offset += sizeof(this->time_last_control_loop_overrun.nsec); - return offset; - } - - virtual const char * getType() override { return "controller_manager_msgs/ControllerStatistics"; }; - virtual const char * getMD5() override { return "697780c372c8d8597a1436d0e2ad3ba8"; }; - - }; - -} -#endif diff --git a/pio_workspace/lib/ros_lib/controller_manager_msgs/ControllersStatistics.h b/pio_workspace/lib/ros_lib/controller_manager_msgs/ControllersStatistics.h deleted file mode 100644 index 8c15f86..0000000 --- a/pio_workspace/lib/ros_lib/controller_manager_msgs/ControllersStatistics.h +++ /dev/null @@ -1,70 +0,0 @@ -#ifndef _ROS_controller_manager_msgs_ControllersStatistics_h -#define _ROS_controller_manager_msgs_ControllersStatistics_h - -#include -#include -#include -#include "ros/msg.h" -#include "std_msgs/Header.h" -#include "controller_manager_msgs/ControllerStatistics.h" - -namespace controller_manager_msgs -{ - - class ControllersStatistics : public ros::Msg - { - public: - typedef std_msgs::Header _header_type; - _header_type header; - uint32_t controller_length; - typedef controller_manager_msgs::ControllerStatistics _controller_type; - _controller_type st_controller; - _controller_type * controller; - - ControllersStatistics(): - header(), - controller_length(0), st_controller(), controller(nullptr) - { - } - - virtual int serialize(unsigned char *outbuffer) const override - { - int offset = 0; - offset += this->header.serialize(outbuffer + offset); - *(outbuffer + offset + 0) = (this->controller_length >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (this->controller_length >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (this->controller_length >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (this->controller_length >> (8 * 3)) & 0xFF; - offset += sizeof(this->controller_length); - for( uint32_t i = 0; i < controller_length; i++){ - offset += this->controller[i].serialize(outbuffer + offset); - } - return offset; - } - - virtual int deserialize(unsigned char *inbuffer) override - { - int offset = 0; - offset += this->header.deserialize(inbuffer + offset); - uint32_t controller_lengthT = ((uint32_t) (*(inbuffer + offset))); - controller_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - controller_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - controller_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - offset += sizeof(this->controller_length); - if(controller_lengthT > controller_length) - this->controller = (controller_manager_msgs::ControllerStatistics*)realloc(this->controller, controller_lengthT * sizeof(controller_manager_msgs::ControllerStatistics)); - controller_length = controller_lengthT; - for( uint32_t i = 0; i < controller_length; i++){ - offset += this->st_controller.deserialize(inbuffer + offset); - memcpy( &(this->controller[i]), &(this->st_controller), sizeof(controller_manager_msgs::ControllerStatistics)); - } - return offset; - } - - virtual const char * getType() override { return "controller_manager_msgs/ControllersStatistics"; }; - virtual const char * getMD5() override { return "a154c347736773e3700d1719105df29d"; }; - - }; - -} -#endif diff --git a/pio_workspace/lib/ros_lib/controller_manager_msgs/HardwareInterfaceResources.h b/pio_workspace/lib/ros_lib/controller_manager_msgs/HardwareInterfaceResources.h deleted file mode 100644 index 21cb6b8..0000000 --- a/pio_workspace/lib/ros_lib/controller_manager_msgs/HardwareInterfaceResources.h +++ /dev/null @@ -1,92 +0,0 @@ -#ifndef _ROS_controller_manager_msgs_HardwareInterfaceResources_h -#define _ROS_controller_manager_msgs_HardwareInterfaceResources_h - -#include -#include -#include -#include "ros/msg.h" - -namespace controller_manager_msgs -{ - - class HardwareInterfaceResources : public ros::Msg - { - public: - typedef const char* _hardware_interface_type; - _hardware_interface_type hardware_interface; - uint32_t resources_length; - typedef char* _resources_type; - _resources_type st_resources; - _resources_type * resources; - - HardwareInterfaceResources(): - hardware_interface(""), - resources_length(0), st_resources(), resources(nullptr) - { - } - - virtual int serialize(unsigned char *outbuffer) const override - { - int offset = 0; - uint32_t length_hardware_interface = strlen(this->hardware_interface); - varToArr(outbuffer + offset, length_hardware_interface); - offset += 4; - memcpy(outbuffer + offset, this->hardware_interface, length_hardware_interface); - offset += length_hardware_interface; - *(outbuffer + offset + 0) = (this->resources_length >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (this->resources_length >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (this->resources_length >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (this->resources_length >> (8 * 3)) & 0xFF; - offset += sizeof(this->resources_length); - for( uint32_t i = 0; i < resources_length; i++){ - uint32_t length_resourcesi = strlen(this->resources[i]); - varToArr(outbuffer + offset, length_resourcesi); - offset += 4; - memcpy(outbuffer + offset, this->resources[i], length_resourcesi); - offset += length_resourcesi; - } - return offset; - } - - virtual int deserialize(unsigned char *inbuffer) override - { - int offset = 0; - uint32_t length_hardware_interface; - arrToVar(length_hardware_interface, (inbuffer + offset)); - offset += 4; - for(unsigned int k= offset; k< offset+length_hardware_interface; ++k){ - inbuffer[k-1]=inbuffer[k]; - } - inbuffer[offset+length_hardware_interface-1]=0; - this->hardware_interface = (char *)(inbuffer + offset-1); - offset += length_hardware_interface; - uint32_t resources_lengthT = ((uint32_t) (*(inbuffer + offset))); - resources_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - resources_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - resources_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - offset += sizeof(this->resources_length); - if(resources_lengthT > resources_length) - this->resources = (char**)realloc(this->resources, resources_lengthT * sizeof(char*)); - resources_length = resources_lengthT; - for( uint32_t i = 0; i < resources_length; i++){ - uint32_t length_st_resources; - arrToVar(length_st_resources, (inbuffer + offset)); - offset += 4; - for(unsigned int k= offset; k< offset+length_st_resources; ++k){ - inbuffer[k-1]=inbuffer[k]; - } - inbuffer[offset+length_st_resources-1]=0; - this->st_resources = (char *)(inbuffer + offset-1); - offset += length_st_resources; - memcpy( &(this->resources[i]), &(this->st_resources), sizeof(char*)); - } - return offset; - } - - virtual const char * getType() override { return "controller_manager_msgs/HardwareInterfaceResources"; }; - virtual const char * getMD5() override { return "f25b55cbf1d1f76e82e5ec9e83f76258"; }; - - }; - -} -#endif diff --git a/pio_workspace/lib/ros_lib/controller_manager_msgs/ListControllerTypes.h b/pio_workspace/lib/ros_lib/controller_manager_msgs/ListControllerTypes.h deleted file mode 100644 index 8b354ae..0000000 --- a/pio_workspace/lib/ros_lib/controller_manager_msgs/ListControllerTypes.h +++ /dev/null @@ -1,144 +0,0 @@ -#ifndef _ROS_SERVICE_ListControllerTypes_h -#define _ROS_SERVICE_ListControllerTypes_h -#include -#include -#include -#include "ros/msg.h" - -namespace controller_manager_msgs -{ - -static const char LISTCONTROLLERTYPES[] = "controller_manager_msgs/ListControllerTypes"; - - class ListControllerTypesRequest : public ros::Msg - { - public: - - ListControllerTypesRequest() - { - } - - virtual int serialize(unsigned char *outbuffer) const override - { - int offset = 0; - return offset; - } - - virtual int deserialize(unsigned char *inbuffer) override - { - int offset = 0; - return offset; - } - - virtual const char * getType() override { return LISTCONTROLLERTYPES; }; - virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; - - }; - - class ListControllerTypesResponse : public ros::Msg - { - public: - uint32_t types_length; - typedef char* _types_type; - _types_type st_types; - _types_type * types; - uint32_t base_classes_length; - typedef char* _base_classes_type; - _base_classes_type st_base_classes; - _base_classes_type * base_classes; - - ListControllerTypesResponse(): - types_length(0), st_types(), types(nullptr), - base_classes_length(0), st_base_classes(), base_classes(nullptr) - { - } - - virtual int serialize(unsigned char *outbuffer) const override - { - int offset = 0; - *(outbuffer + offset + 0) = (this->types_length >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (this->types_length >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (this->types_length >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (this->types_length >> (8 * 3)) & 0xFF; - offset += sizeof(this->types_length); - for( uint32_t i = 0; i < types_length; i++){ - uint32_t length_typesi = strlen(this->types[i]); - varToArr(outbuffer + offset, length_typesi); - offset += 4; - memcpy(outbuffer + offset, this->types[i], length_typesi); - offset += length_typesi; - } - *(outbuffer + offset + 0) = (this->base_classes_length >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (this->base_classes_length >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (this->base_classes_length >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (this->base_classes_length >> (8 * 3)) & 0xFF; - offset += sizeof(this->base_classes_length); - for( uint32_t i = 0; i < base_classes_length; i++){ - uint32_t length_base_classesi = strlen(this->base_classes[i]); - varToArr(outbuffer + offset, length_base_classesi); - offset += 4; - memcpy(outbuffer + offset, this->base_classes[i], length_base_classesi); - offset += length_base_classesi; - } - return offset; - } - - virtual int deserialize(unsigned char *inbuffer) override - { - int offset = 0; - uint32_t types_lengthT = ((uint32_t) (*(inbuffer + offset))); - types_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - types_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - types_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - offset += sizeof(this->types_length); - if(types_lengthT > types_length) - this->types = (char**)realloc(this->types, types_lengthT * sizeof(char*)); - types_length = types_lengthT; - for( uint32_t i = 0; i < types_length; i++){ - uint32_t length_st_types; - arrToVar(length_st_types, (inbuffer + offset)); - offset += 4; - for(unsigned int k= offset; k< offset+length_st_types; ++k){ - inbuffer[k-1]=inbuffer[k]; - } - inbuffer[offset+length_st_types-1]=0; - this->st_types = (char *)(inbuffer + offset-1); - offset += length_st_types; - memcpy( &(this->types[i]), &(this->st_types), sizeof(char*)); - } - uint32_t base_classes_lengthT = ((uint32_t) (*(inbuffer + offset))); - base_classes_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - base_classes_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - base_classes_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - offset += sizeof(this->base_classes_length); - if(base_classes_lengthT > base_classes_length) - this->base_classes = (char**)realloc(this->base_classes, base_classes_lengthT * sizeof(char*)); - base_classes_length = base_classes_lengthT; - for( uint32_t i = 0; i < base_classes_length; i++){ - uint32_t length_st_base_classes; - arrToVar(length_st_base_classes, (inbuffer + offset)); - offset += 4; - for(unsigned int k= offset; k< offset+length_st_base_classes; ++k){ - inbuffer[k-1]=inbuffer[k]; - } - inbuffer[offset+length_st_base_classes-1]=0; - this->st_base_classes = (char *)(inbuffer + offset-1); - offset += length_st_base_classes; - memcpy( &(this->base_classes[i]), &(this->st_base_classes), sizeof(char*)); - } - return offset; - } - - virtual const char * getType() override { return LISTCONTROLLERTYPES; }; - virtual const char * getMD5() override { return "c1d4cd11aefa9f97ba4aeb5b33987f4e"; }; - - }; - - class ListControllerTypes { - public: - typedef ListControllerTypesRequest Request; - typedef ListControllerTypesResponse Response; - }; - -} -#endif diff --git a/pio_workspace/lib/ros_lib/controller_manager_msgs/ListControllers.h b/pio_workspace/lib/ros_lib/controller_manager_msgs/ListControllers.h deleted file mode 100644 index 613db1f..0000000 --- a/pio_workspace/lib/ros_lib/controller_manager_msgs/ListControllers.h +++ /dev/null @@ -1,96 +0,0 @@ -#ifndef _ROS_SERVICE_ListControllers_h -#define _ROS_SERVICE_ListControllers_h -#include -#include -#include -#include "ros/msg.h" -#include "controller_manager_msgs/ControllerState.h" - -namespace controller_manager_msgs -{ - -static const char LISTCONTROLLERS[] = "controller_manager_msgs/ListControllers"; - - class ListControllersRequest : public ros::Msg - { - public: - - ListControllersRequest() - { - } - - virtual int serialize(unsigned char *outbuffer) const override - { - int offset = 0; - return offset; - } - - virtual int deserialize(unsigned char *inbuffer) override - { - int offset = 0; - return offset; - } - - virtual const char * getType() override { return LISTCONTROLLERS; }; - virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; - - }; - - class ListControllersResponse : public ros::Msg - { - public: - uint32_t controller_length; - typedef controller_manager_msgs::ControllerState _controller_type; - _controller_type st_controller; - _controller_type * controller; - - ListControllersResponse(): - controller_length(0), st_controller(), controller(nullptr) - { - } - - virtual int serialize(unsigned char *outbuffer) const override - { - int offset = 0; - *(outbuffer + offset + 0) = (this->controller_length >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (this->controller_length >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (this->controller_length >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (this->controller_length >> (8 * 3)) & 0xFF; - offset += sizeof(this->controller_length); - for( uint32_t i = 0; i < controller_length; i++){ - offset += this->controller[i].serialize(outbuffer + offset); - } - return offset; - } - - virtual int deserialize(unsigned char *inbuffer) override - { - int offset = 0; - uint32_t controller_lengthT = ((uint32_t) (*(inbuffer + offset))); - controller_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - controller_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - controller_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - offset += sizeof(this->controller_length); - if(controller_lengthT > controller_length) - this->controller = (controller_manager_msgs::ControllerState*)realloc(this->controller, controller_lengthT * sizeof(controller_manager_msgs::ControllerState)); - controller_length = controller_lengthT; - for( uint32_t i = 0; i < controller_length; i++){ - offset += this->st_controller.deserialize(inbuffer + offset); - memcpy( &(this->controller[i]), &(this->st_controller), sizeof(controller_manager_msgs::ControllerState)); - } - return offset; - } - - virtual const char * getType() override { return LISTCONTROLLERS; }; - virtual const char * getMD5() override { return "1341feb2e63fa791f855565d0da950d8"; }; - - }; - - class ListControllers { - public: - typedef ListControllersRequest Request; - typedef ListControllersResponse Response; - }; - -} -#endif diff --git a/pio_workspace/lib/ros_lib/controller_manager_msgs/LoadController.h b/pio_workspace/lib/ros_lib/controller_manager_msgs/LoadController.h deleted file mode 100644 index 5774fc3..0000000 --- a/pio_workspace/lib/ros_lib/controller_manager_msgs/LoadController.h +++ /dev/null @@ -1,105 +0,0 @@ -#ifndef _ROS_SERVICE_LoadController_h -#define _ROS_SERVICE_LoadController_h -#include -#include -#include -#include "ros/msg.h" - -namespace controller_manager_msgs -{ - -static const char LOADCONTROLLER[] = "controller_manager_msgs/LoadController"; - - class LoadControllerRequest : public ros::Msg - { - public: - typedef const char* _name_type; - _name_type name; - - LoadControllerRequest(): - name("") - { - } - - virtual int serialize(unsigned char *outbuffer) const override - { - int offset = 0; - uint32_t length_name = strlen(this->name); - varToArr(outbuffer + offset, length_name); - offset += 4; - memcpy(outbuffer + offset, this->name, length_name); - offset += length_name; - return offset; - } - - virtual int deserialize(unsigned char *inbuffer) override - { - int offset = 0; - uint32_t length_name; - arrToVar(length_name, (inbuffer + offset)); - offset += 4; - for(unsigned int k= offset; k< offset+length_name; ++k){ - inbuffer[k-1]=inbuffer[k]; - } - inbuffer[offset+length_name-1]=0; - this->name = (char *)(inbuffer + offset-1); - offset += length_name; - return offset; - } - - virtual const char * getType() override { return LOADCONTROLLER; }; - virtual const char * getMD5() override { return "c1f3d28f1b044c871e6eff2e9fc3c667"; }; - - }; - - class LoadControllerResponse : public ros::Msg - { - public: - typedef bool _ok_type; - _ok_type ok; - - LoadControllerResponse(): - ok(0) - { - } - - virtual int serialize(unsigned char *outbuffer) const override - { - int offset = 0; - union { - bool real; - uint8_t base; - } u_ok; - u_ok.real = this->ok; - *(outbuffer + offset + 0) = (u_ok.base >> (8 * 0)) & 0xFF; - offset += sizeof(this->ok); - return offset; - } - - virtual int deserialize(unsigned char *inbuffer) override - { - int offset = 0; - union { - bool real; - uint8_t base; - } u_ok; - u_ok.base = 0; - u_ok.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); - this->ok = u_ok.real; - offset += sizeof(this->ok); - return offset; - } - - virtual const char * getType() override { return LOADCONTROLLER; }; - virtual const char * getMD5() override { return "6f6da3883749771fac40d6deb24a8c02"; }; - - }; - - class LoadController { - public: - typedef LoadControllerRequest Request; - typedef LoadControllerResponse Response; - }; - -} -#endif diff --git a/pio_workspace/lib/ros_lib/controller_manager_msgs/ReloadControllerLibraries.h b/pio_workspace/lib/ros_lib/controller_manager_msgs/ReloadControllerLibraries.h deleted file mode 100644 index a2fbef2..0000000 --- a/pio_workspace/lib/ros_lib/controller_manager_msgs/ReloadControllerLibraries.h +++ /dev/null @@ -1,106 +0,0 @@ -#ifndef _ROS_SERVICE_ReloadControllerLibraries_h -#define _ROS_SERVICE_ReloadControllerLibraries_h -#include -#include -#include -#include "ros/msg.h" - -namespace controller_manager_msgs -{ - -static const char RELOADCONTROLLERLIBRARIES[] = "controller_manager_msgs/ReloadControllerLibraries"; - - class ReloadControllerLibrariesRequest : public ros::Msg - { - public: - typedef bool _force_kill_type; - _force_kill_type force_kill; - - ReloadControllerLibrariesRequest(): - force_kill(0) - { - } - - virtual int serialize(unsigned char *outbuffer) const override - { - int offset = 0; - union { - bool real; - uint8_t base; - } u_force_kill; - u_force_kill.real = this->force_kill; - *(outbuffer + offset + 0) = (u_force_kill.base >> (8 * 0)) & 0xFF; - offset += sizeof(this->force_kill); - return offset; - } - - virtual int deserialize(unsigned char *inbuffer) override - { - int offset = 0; - union { - bool real; - uint8_t base; - } u_force_kill; - u_force_kill.base = 0; - u_force_kill.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); - this->force_kill = u_force_kill.real; - offset += sizeof(this->force_kill); - return offset; - } - - virtual const char * getType() override { return RELOADCONTROLLERLIBRARIES; }; - virtual const char * getMD5() override { return "18442b59be9479097f11c543bddbac62"; }; - - }; - - class ReloadControllerLibrariesResponse : public ros::Msg - { - public: - typedef bool _ok_type; - _ok_type ok; - - ReloadControllerLibrariesResponse(): - ok(0) - { - } - - virtual int serialize(unsigned char *outbuffer) const override - { - int offset = 0; - union { - bool real; - uint8_t base; - } u_ok; - u_ok.real = this->ok; - *(outbuffer + offset + 0) = (u_ok.base >> (8 * 0)) & 0xFF; - offset += sizeof(this->ok); - return offset; - } - - virtual int deserialize(unsigned char *inbuffer) override - { - int offset = 0; - union { - bool real; - uint8_t base; - } u_ok; - u_ok.base = 0; - u_ok.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); - this->ok = u_ok.real; - offset += sizeof(this->ok); - return offset; - } - - virtual const char * getType() override { return RELOADCONTROLLERLIBRARIES; }; - virtual const char * getMD5() override { return "6f6da3883749771fac40d6deb24a8c02"; }; - - }; - - class ReloadControllerLibraries { - public: - typedef ReloadControllerLibrariesRequest Request; - typedef ReloadControllerLibrariesResponse Response; - }; - -} -#endif diff --git a/pio_workspace/lib/ros_lib/controller_manager_msgs/SwitchController.h b/pio_workspace/lib/ros_lib/controller_manager_msgs/SwitchController.h deleted file mode 100644 index 3222e8b..0000000 --- a/pio_workspace/lib/ros_lib/controller_manager_msgs/SwitchController.h +++ /dev/null @@ -1,211 +0,0 @@ -#ifndef _ROS_SERVICE_SwitchController_h -#define _ROS_SERVICE_SwitchController_h -#include -#include -#include -#include "ros/msg.h" - -namespace controller_manager_msgs -{ - -static const char SWITCHCONTROLLER[] = "controller_manager_msgs/SwitchController"; - - class SwitchControllerRequest : public ros::Msg - { - public: - uint32_t start_controllers_length; - typedef char* _start_controllers_type; - _start_controllers_type st_start_controllers; - _start_controllers_type * start_controllers; - uint32_t stop_controllers_length; - typedef char* _stop_controllers_type; - _stop_controllers_type st_stop_controllers; - _stop_controllers_type * stop_controllers; - typedef int32_t _strictness_type; - _strictness_type strictness; - typedef bool _start_asap_type; - _start_asap_type start_asap; - typedef float _timeout_type; - _timeout_type timeout; - enum { BEST_EFFORT = 1 }; - enum { STRICT = 2 }; - - SwitchControllerRequest(): - start_controllers_length(0), st_start_controllers(), start_controllers(nullptr), - stop_controllers_length(0), st_stop_controllers(), stop_controllers(nullptr), - strictness(0), - start_asap(0), - timeout(0) - { - } - - virtual int serialize(unsigned char *outbuffer) const override - { - int offset = 0; - *(outbuffer + offset + 0) = (this->start_controllers_length >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (this->start_controllers_length >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (this->start_controllers_length >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (this->start_controllers_length >> (8 * 3)) & 0xFF; - offset += sizeof(this->start_controllers_length); - for( uint32_t i = 0; i < start_controllers_length; i++){ - uint32_t length_start_controllersi = strlen(this->start_controllers[i]); - varToArr(outbuffer + offset, length_start_controllersi); - offset += 4; - memcpy(outbuffer + offset, this->start_controllers[i], length_start_controllersi); - offset += length_start_controllersi; - } - *(outbuffer + offset + 0) = (this->stop_controllers_length >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (this->stop_controllers_length >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (this->stop_controllers_length >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (this->stop_controllers_length >> (8 * 3)) & 0xFF; - offset += sizeof(this->stop_controllers_length); - for( uint32_t i = 0; i < stop_controllers_length; i++){ - uint32_t length_stop_controllersi = strlen(this->stop_controllers[i]); - varToArr(outbuffer + offset, length_stop_controllersi); - offset += 4; - memcpy(outbuffer + offset, this->stop_controllers[i], length_stop_controllersi); - offset += length_stop_controllersi; - } - union { - int32_t real; - uint32_t base; - } u_strictness; - u_strictness.real = this->strictness; - *(outbuffer + offset + 0) = (u_strictness.base >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (u_strictness.base >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (u_strictness.base >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (u_strictness.base >> (8 * 3)) & 0xFF; - offset += sizeof(this->strictness); - union { - bool real; - uint8_t base; - } u_start_asap; - u_start_asap.real = this->start_asap; - *(outbuffer + offset + 0) = (u_start_asap.base >> (8 * 0)) & 0xFF; - offset += sizeof(this->start_asap); - offset += serializeAvrFloat64(outbuffer + offset, this->timeout); - return offset; - } - - virtual int deserialize(unsigned char *inbuffer) override - { - int offset = 0; - uint32_t start_controllers_lengthT = ((uint32_t) (*(inbuffer + offset))); - start_controllers_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - start_controllers_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - start_controllers_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - offset += sizeof(this->start_controllers_length); - if(start_controllers_lengthT > start_controllers_length) - this->start_controllers = (char**)realloc(this->start_controllers, start_controllers_lengthT * sizeof(char*)); - start_controllers_length = start_controllers_lengthT; - for( uint32_t i = 0; i < start_controllers_length; i++){ - uint32_t length_st_start_controllers; - arrToVar(length_st_start_controllers, (inbuffer + offset)); - offset += 4; - for(unsigned int k= offset; k< offset+length_st_start_controllers; ++k){ - inbuffer[k-1]=inbuffer[k]; - } - inbuffer[offset+length_st_start_controllers-1]=0; - this->st_start_controllers = (char *)(inbuffer + offset-1); - offset += length_st_start_controllers; - memcpy( &(this->start_controllers[i]), &(this->st_start_controllers), sizeof(char*)); - } - uint32_t stop_controllers_lengthT = ((uint32_t) (*(inbuffer + offset))); - stop_controllers_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - stop_controllers_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - stop_controllers_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - offset += sizeof(this->stop_controllers_length); - if(stop_controllers_lengthT > stop_controllers_length) - this->stop_controllers = (char**)realloc(this->stop_controllers, stop_controllers_lengthT * sizeof(char*)); - stop_controllers_length = stop_controllers_lengthT; - for( uint32_t i = 0; i < stop_controllers_length; i++){ - uint32_t length_st_stop_controllers; - arrToVar(length_st_stop_controllers, (inbuffer + offset)); - offset += 4; - for(unsigned int k= offset; k< offset+length_st_stop_controllers; ++k){ - inbuffer[k-1]=inbuffer[k]; - } - inbuffer[offset+length_st_stop_controllers-1]=0; - this->st_stop_controllers = (char *)(inbuffer + offset-1); - offset += length_st_stop_controllers; - memcpy( &(this->stop_controllers[i]), &(this->st_stop_controllers), sizeof(char*)); - } - union { - int32_t real; - uint32_t base; - } u_strictness; - u_strictness.base = 0; - u_strictness.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); - u_strictness.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - u_strictness.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - u_strictness.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - this->strictness = u_strictness.real; - offset += sizeof(this->strictness); - union { - bool real; - uint8_t base; - } u_start_asap; - u_start_asap.base = 0; - u_start_asap.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); - this->start_asap = u_start_asap.real; - offset += sizeof(this->start_asap); - offset += deserializeAvrFloat64(inbuffer + offset, &(this->timeout)); - return offset; - } - - virtual const char * getType() override { return SWITCHCONTROLLER; }; - virtual const char * getMD5() override { return "36d99a977432b71d4bf16ce5847949d7"; }; - - }; - - class SwitchControllerResponse : public ros::Msg - { - public: - typedef bool _ok_type; - _ok_type ok; - - SwitchControllerResponse(): - ok(0) - { - } - - virtual int serialize(unsigned char *outbuffer) const override - { - int offset = 0; - union { - bool real; - uint8_t base; - } u_ok; - u_ok.real = this->ok; - *(outbuffer + offset + 0) = (u_ok.base >> (8 * 0)) & 0xFF; - offset += sizeof(this->ok); - return offset; - } - - virtual int deserialize(unsigned char *inbuffer) override - { - int offset = 0; - union { - bool real; - uint8_t base; - } u_ok; - u_ok.base = 0; - u_ok.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); - this->ok = u_ok.real; - offset += sizeof(this->ok); - return offset; - } - - virtual const char * getType() override { return SWITCHCONTROLLER; }; - virtual const char * getMD5() override { return "6f6da3883749771fac40d6deb24a8c02"; }; - - }; - - class SwitchController { - public: - typedef SwitchControllerRequest Request; - typedef SwitchControllerResponse Response; - }; - -} -#endif diff --git a/pio_workspace/lib/ros_lib/controller_manager_msgs/UnloadController.h b/pio_workspace/lib/ros_lib/controller_manager_msgs/UnloadController.h deleted file mode 100644 index da59ff5..0000000 --- a/pio_workspace/lib/ros_lib/controller_manager_msgs/UnloadController.h +++ /dev/null @@ -1,105 +0,0 @@ -#ifndef _ROS_SERVICE_UnloadController_h -#define _ROS_SERVICE_UnloadController_h -#include -#include -#include -#include "ros/msg.h" - -namespace controller_manager_msgs -{ - -static const char UNLOADCONTROLLER[] = "controller_manager_msgs/UnloadController"; - - class UnloadControllerRequest : public ros::Msg - { - public: - typedef const char* _name_type; - _name_type name; - - UnloadControllerRequest(): - name("") - { - } - - virtual int serialize(unsigned char *outbuffer) const override - { - int offset = 0; - uint32_t length_name = strlen(this->name); - varToArr(outbuffer + offset, length_name); - offset += 4; - memcpy(outbuffer + offset, this->name, length_name); - offset += length_name; - return offset; - } - - virtual int deserialize(unsigned char *inbuffer) override - { - int offset = 0; - uint32_t length_name; - arrToVar(length_name, (inbuffer + offset)); - offset += 4; - for(unsigned int k= offset; k< offset+length_name; ++k){ - inbuffer[k-1]=inbuffer[k]; - } - inbuffer[offset+length_name-1]=0; - this->name = (char *)(inbuffer + offset-1); - offset += length_name; - return offset; - } - - virtual const char * getType() override { return UNLOADCONTROLLER; }; - virtual const char * getMD5() override { return "c1f3d28f1b044c871e6eff2e9fc3c667"; }; - - }; - - class UnloadControllerResponse : public ros::Msg - { - public: - typedef bool _ok_type; - _ok_type ok; - - UnloadControllerResponse(): - ok(0) - { - } - - virtual int serialize(unsigned char *outbuffer) const override - { - int offset = 0; - union { - bool real; - uint8_t base; - } u_ok; - u_ok.real = this->ok; - *(outbuffer + offset + 0) = (u_ok.base >> (8 * 0)) & 0xFF; - offset += sizeof(this->ok); - return offset; - } - - virtual int deserialize(unsigned char *inbuffer) override - { - int offset = 0; - union { - bool real; - uint8_t base; - } u_ok; - u_ok.base = 0; - u_ok.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); - this->ok = u_ok.real; - offset += sizeof(this->ok); - return offset; - } - - virtual const char * getType() override { return UNLOADCONTROLLER; }; - virtual const char * getMD5() override { return "6f6da3883749771fac40d6deb24a8c02"; }; - - }; - - class UnloadController { - public: - typedef UnloadControllerRequest Request; - typedef UnloadControllerResponse Response; - }; - -} -#endif diff --git a/pio_workspace/lib/ros_lib/costmap_2d/VoxelGrid.h b/pio_workspace/lib/ros_lib/costmap_2d/VoxelGrid.h new file mode 100644 index 0000000..4998dab --- /dev/null +++ b/pio_workspace/lib/ros_lib/costmap_2d/VoxelGrid.h @@ -0,0 +1,128 @@ +#ifndef _ROS_costmap_2d_VoxelGrid_h +#define _ROS_costmap_2d_VoxelGrid_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Point32.h" +#include "geometry_msgs/Vector3.h" + +namespace costmap_2d +{ + + class VoxelGrid : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t data_length; + typedef uint32_t _data_type; + _data_type st_data; + _data_type * data; + typedef geometry_msgs::Point32 _origin_type; + _origin_type origin; + typedef geometry_msgs::Vector3 _resolutions_type; + _resolutions_type resolutions; + typedef uint32_t _size_x_type; + _size_x_type size_x; + typedef uint32_t _size_y_type; + _size_y_type size_y; + typedef uint32_t _size_z_type; + _size_z_type size_z; + + VoxelGrid(): + header(), + data_length(0), st_data(), data(nullptr), + origin(), + resolutions(), + size_x(0), + size_y(0), + size_z(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->data_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->data_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->data_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->data_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->data_length); + for( uint32_t i = 0; i < data_length; i++){ + *(outbuffer + offset + 0) = (this->data[i] >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->data[i] >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->data[i] >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->data[i] >> (8 * 3)) & 0xFF; + offset += sizeof(this->data[i]); + } + offset += this->origin.serialize(outbuffer + offset); + offset += this->resolutions.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->size_x >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->size_x >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->size_x >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->size_x >> (8 * 3)) & 0xFF; + offset += sizeof(this->size_x); + *(outbuffer + offset + 0) = (this->size_y >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->size_y >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->size_y >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->size_y >> (8 * 3)) & 0xFF; + offset += sizeof(this->size_y); + *(outbuffer + offset + 0) = (this->size_z >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->size_z >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->size_z >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->size_z >> (8 * 3)) & 0xFF; + offset += sizeof(this->size_z); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t data_lengthT = ((uint32_t) (*(inbuffer + offset))); + data_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + data_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + data_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->data_length); + if(data_lengthT > data_length) + this->data = (uint32_t*)realloc(this->data, data_lengthT * sizeof(uint32_t)); + data_length = data_lengthT; + for( uint32_t i = 0; i < data_length; i++){ + this->st_data = ((uint32_t) (*(inbuffer + offset))); + this->st_data |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->st_data |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->st_data |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(uint32_t)); + } + offset += this->origin.deserialize(inbuffer + offset); + offset += this->resolutions.deserialize(inbuffer + offset); + this->size_x = ((uint32_t) (*(inbuffer + offset))); + this->size_x |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->size_x |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->size_x |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->size_x); + this->size_y = ((uint32_t) (*(inbuffer + offset))); + this->size_y |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->size_y |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->size_y |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->size_y); + this->size_z = ((uint32_t) (*(inbuffer + offset))); + this->size_z |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->size_z |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->size_z |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->size_z); + return offset; + } + + virtual const char * getType() override { return "costmap_2d/VoxelGrid"; }; + virtual const char * getMD5() override { return "48a040827e1322073d78ece5a497029c"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/find_object_2d/DetectionInfo.h b/pio_workspace/lib/ros_lib/find_object_2d/DetectionInfo.h new file mode 100644 index 0000000..c664b54 --- /dev/null +++ b/pio_workspace/lib/ros_lib/find_object_2d/DetectionInfo.h @@ -0,0 +1,222 @@ +#ifndef _ROS_find_object_2d_DetectionInfo_h +#define _ROS_find_object_2d_DetectionInfo_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "std_msgs/Int32.h" +#include "std_msgs/String.h" +#include "std_msgs/Float32MultiArray.h" + +namespace find_object_2d +{ + + class DetectionInfo : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t ids_length; + typedef std_msgs::Int32 _ids_type; + _ids_type st_ids; + _ids_type * ids; + uint32_t widths_length; + typedef std_msgs::Int32 _widths_type; + _widths_type st_widths; + _widths_type * widths; + uint32_t heights_length; + typedef std_msgs::Int32 _heights_type; + _heights_type st_heights; + _heights_type * heights; + uint32_t file_paths_length; + typedef std_msgs::String _file_paths_type; + _file_paths_type st_file_paths; + _file_paths_type * file_paths; + uint32_t inliers_length; + typedef std_msgs::Int32 _inliers_type; + _inliers_type st_inliers; + _inliers_type * inliers; + uint32_t outliers_length; + typedef std_msgs::Int32 _outliers_type; + _outliers_type st_outliers; + _outliers_type * outliers; + uint32_t homographies_length; + typedef std_msgs::Float32MultiArray _homographies_type; + _homographies_type st_homographies; + _homographies_type * homographies; + + DetectionInfo(): + header(), + ids_length(0), st_ids(), ids(nullptr), + widths_length(0), st_widths(), widths(nullptr), + heights_length(0), st_heights(), heights(nullptr), + file_paths_length(0), st_file_paths(), file_paths(nullptr), + inliers_length(0), st_inliers(), inliers(nullptr), + outliers_length(0), st_outliers(), outliers(nullptr), + homographies_length(0), st_homographies(), homographies(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->ids_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->ids_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->ids_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->ids_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->ids_length); + for( uint32_t i = 0; i < ids_length; i++){ + offset += this->ids[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->widths_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->widths_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->widths_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->widths_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->widths_length); + for( uint32_t i = 0; i < widths_length; i++){ + offset += this->widths[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->heights_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->heights_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->heights_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->heights_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->heights_length); + for( uint32_t i = 0; i < heights_length; i++){ + offset += this->heights[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->file_paths_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->file_paths_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->file_paths_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->file_paths_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->file_paths_length); + for( uint32_t i = 0; i < file_paths_length; i++){ + offset += this->file_paths[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->inliers_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->inliers_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->inliers_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->inliers_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->inliers_length); + for( uint32_t i = 0; i < inliers_length; i++){ + offset += this->inliers[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->outliers_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->outliers_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->outliers_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->outliers_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->outliers_length); + for( uint32_t i = 0; i < outliers_length; i++){ + offset += this->outliers[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->homographies_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->homographies_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->homographies_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->homographies_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->homographies_length); + for( uint32_t i = 0; i < homographies_length; i++){ + offset += this->homographies[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t ids_lengthT = ((uint32_t) (*(inbuffer + offset))); + ids_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + ids_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + ids_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->ids_length); + if(ids_lengthT > ids_length) + this->ids = (std_msgs::Int32*)realloc(this->ids, ids_lengthT * sizeof(std_msgs::Int32)); + ids_length = ids_lengthT; + for( uint32_t i = 0; i < ids_length; i++){ + offset += this->st_ids.deserialize(inbuffer + offset); + memcpy( &(this->ids[i]), &(this->st_ids), sizeof(std_msgs::Int32)); + } + uint32_t widths_lengthT = ((uint32_t) (*(inbuffer + offset))); + widths_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + widths_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + widths_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->widths_length); + if(widths_lengthT > widths_length) + this->widths = (std_msgs::Int32*)realloc(this->widths, widths_lengthT * sizeof(std_msgs::Int32)); + widths_length = widths_lengthT; + for( uint32_t i = 0; i < widths_length; i++){ + offset += this->st_widths.deserialize(inbuffer + offset); + memcpy( &(this->widths[i]), &(this->st_widths), sizeof(std_msgs::Int32)); + } + uint32_t heights_lengthT = ((uint32_t) (*(inbuffer + offset))); + heights_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + heights_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + heights_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->heights_length); + if(heights_lengthT > heights_length) + this->heights = (std_msgs::Int32*)realloc(this->heights, heights_lengthT * sizeof(std_msgs::Int32)); + heights_length = heights_lengthT; + for( uint32_t i = 0; i < heights_length; i++){ + offset += this->st_heights.deserialize(inbuffer + offset); + memcpy( &(this->heights[i]), &(this->st_heights), sizeof(std_msgs::Int32)); + } + uint32_t file_paths_lengthT = ((uint32_t) (*(inbuffer + offset))); + file_paths_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + file_paths_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + file_paths_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->file_paths_length); + if(file_paths_lengthT > file_paths_length) + this->file_paths = (std_msgs::String*)realloc(this->file_paths, file_paths_lengthT * sizeof(std_msgs::String)); + file_paths_length = file_paths_lengthT; + for( uint32_t i = 0; i < file_paths_length; i++){ + offset += this->st_file_paths.deserialize(inbuffer + offset); + memcpy( &(this->file_paths[i]), &(this->st_file_paths), sizeof(std_msgs::String)); + } + uint32_t inliers_lengthT = ((uint32_t) (*(inbuffer + offset))); + inliers_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + inliers_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + inliers_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->inliers_length); + if(inliers_lengthT > inliers_length) + this->inliers = (std_msgs::Int32*)realloc(this->inliers, inliers_lengthT * sizeof(std_msgs::Int32)); + inliers_length = inliers_lengthT; + for( uint32_t i = 0; i < inliers_length; i++){ + offset += this->st_inliers.deserialize(inbuffer + offset); + memcpy( &(this->inliers[i]), &(this->st_inliers), sizeof(std_msgs::Int32)); + } + uint32_t outliers_lengthT = ((uint32_t) (*(inbuffer + offset))); + outliers_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + outliers_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + outliers_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->outliers_length); + if(outliers_lengthT > outliers_length) + this->outliers = (std_msgs::Int32*)realloc(this->outliers, outliers_lengthT * sizeof(std_msgs::Int32)); + outliers_length = outliers_lengthT; + for( uint32_t i = 0; i < outliers_length; i++){ + offset += this->st_outliers.deserialize(inbuffer + offset); + memcpy( &(this->outliers[i]), &(this->st_outliers), sizeof(std_msgs::Int32)); + } + uint32_t homographies_lengthT = ((uint32_t) (*(inbuffer + offset))); + homographies_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + homographies_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + homographies_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->homographies_length); + if(homographies_lengthT > homographies_length) + this->homographies = (std_msgs::Float32MultiArray*)realloc(this->homographies, homographies_lengthT * sizeof(std_msgs::Float32MultiArray)); + homographies_length = homographies_lengthT; + for( uint32_t i = 0; i < homographies_length; i++){ + offset += this->st_homographies.deserialize(inbuffer + offset); + memcpy( &(this->homographies[i]), &(this->st_homographies), sizeof(std_msgs::Float32MultiArray)); + } + return offset; + } + + virtual const char * getType() override { return "find_object_2d/DetectionInfo"; }; + virtual const char * getMD5() override { return "b640b611f324585835ba0cb953c35aa3"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/find_object_2d/ObjectsStamped.h b/pio_workspace/lib/ros_lib/find_object_2d/ObjectsStamped.h new file mode 100644 index 0000000..5abd268 --- /dev/null +++ b/pio_workspace/lib/ros_lib/find_object_2d/ObjectsStamped.h @@ -0,0 +1,50 @@ +#ifndef _ROS_find_object_2d_ObjectsStamped_h +#define _ROS_find_object_2d_ObjectsStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "std_msgs/Float32MultiArray.h" + +namespace find_object_2d +{ + + class ObjectsStamped : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef std_msgs::Float32MultiArray _objects_type; + _objects_type objects; + + ObjectsStamped(): + header(), + objects() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->objects.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->objects.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "find_object_2d/ObjectsStamped"; }; + virtual const char * getMD5() override { return "5ec2736b62b92d101276c97e8db387b1"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/gazebo_msgs/ApplyBodyWrench.h b/pio_workspace/lib/ros_lib/gazebo_msgs/ApplyBodyWrench.h index f08e641..54e8550 100644 --- a/pio_workspace/lib/ros_lib/gazebo_msgs/ApplyBodyWrench.h +++ b/pio_workspace/lib/ros_lib/gazebo_msgs/ApplyBodyWrench.h @@ -4,10 +4,10 @@ #include #include #include "ros/msg.h" -#include "ros/duration.h" #include "ros/time.h" -#include "geometry_msgs/Wrench.h" #include "geometry_msgs/Point.h" +#include "geometry_msgs/Wrench.h" +#include "ros/duration.h" namespace gazebo_msgs { diff --git a/pio_workspace/lib/ros_lib/gazebo_msgs/ApplyJointEffort.h b/pio_workspace/lib/ros_lib/gazebo_msgs/ApplyJointEffort.h index c33709d..e51d34d 100644 --- a/pio_workspace/lib/ros_lib/gazebo_msgs/ApplyJointEffort.h +++ b/pio_workspace/lib/ros_lib/gazebo_msgs/ApplyJointEffort.h @@ -4,8 +4,8 @@ #include #include #include "ros/msg.h" -#include "ros/duration.h" #include "ros/time.h" +#include "ros/duration.h" namespace gazebo_msgs { diff --git a/pio_workspace/lib/ros_lib/gazebo_msgs/GetModelState.h b/pio_workspace/lib/ros_lib/gazebo_msgs/GetModelState.h index 4eca1e7..ba16528 100644 --- a/pio_workspace/lib/ros_lib/gazebo_msgs/GetModelState.h +++ b/pio_workspace/lib/ros_lib/gazebo_msgs/GetModelState.h @@ -4,9 +4,9 @@ #include #include #include "ros/msg.h" -#include "std_msgs/Header.h" #include "geometry_msgs/Twist.h" #include "geometry_msgs/Pose.h" +#include "std_msgs/Header.h" namespace gazebo_msgs { diff --git a/pio_workspace/lib/ros_lib/gazebo_msgs/SetJointTrajectory.h b/pio_workspace/lib/ros_lib/gazebo_msgs/SetJointTrajectory.h index 88cb34f..95ee7be 100644 --- a/pio_workspace/lib/ros_lib/gazebo_msgs/SetJointTrajectory.h +++ b/pio_workspace/lib/ros_lib/gazebo_msgs/SetJointTrajectory.h @@ -4,8 +4,8 @@ #include #include #include "ros/msg.h" -#include "trajectory_msgs/JointTrajectory.h" #include "geometry_msgs/Pose.h" +#include "trajectory_msgs/JointTrajectory.h" namespace gazebo_msgs { diff --git a/pio_workspace/lib/ros_lib/geographic_msgs/BoundingBox.h b/pio_workspace/lib/ros_lib/geographic_msgs/BoundingBox.h new file mode 100644 index 0000000..cacf42a --- /dev/null +++ b/pio_workspace/lib/ros_lib/geographic_msgs/BoundingBox.h @@ -0,0 +1,49 @@ +#ifndef _ROS_geographic_msgs_BoundingBox_h +#define _ROS_geographic_msgs_BoundingBox_h + +#include +#include +#include +#include "ros/msg.h" +#include "geographic_msgs/GeoPoint.h" + +namespace geographic_msgs +{ + + class BoundingBox : public ros::Msg + { + public: + typedef geographic_msgs::GeoPoint _min_pt_type; + _min_pt_type min_pt; + typedef geographic_msgs::GeoPoint _max_pt_type; + _max_pt_type max_pt; + + BoundingBox(): + min_pt(), + max_pt() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->min_pt.serialize(outbuffer + offset); + offset += this->max_pt.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->min_pt.deserialize(inbuffer + offset); + offset += this->max_pt.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "geographic_msgs/BoundingBox"; }; + virtual const char * getMD5() override { return "f62e8b5e390a3ac7603250d46e8f8446"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/geographic_msgs/GeoPath.h b/pio_workspace/lib/ros_lib/geographic_msgs/GeoPath.h new file mode 100644 index 0000000..d9216f2 --- /dev/null +++ b/pio_workspace/lib/ros_lib/geographic_msgs/GeoPath.h @@ -0,0 +1,70 @@ +#ifndef _ROS_geographic_msgs_GeoPath_h +#define _ROS_geographic_msgs_GeoPath_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geographic_msgs/GeoPoseStamped.h" + +namespace geographic_msgs +{ + + class GeoPath : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t poses_length; + typedef geographic_msgs::GeoPoseStamped _poses_type; + _poses_type st_poses; + _poses_type * poses; + + GeoPath(): + header(), + poses_length(0), st_poses(), poses(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->poses_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->poses_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->poses_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->poses_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->poses_length); + for( uint32_t i = 0; i < poses_length; i++){ + offset += this->poses[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t poses_lengthT = ((uint32_t) (*(inbuffer + offset))); + poses_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + poses_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + poses_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->poses_length); + if(poses_lengthT > poses_length) + this->poses = (geographic_msgs::GeoPoseStamped*)realloc(this->poses, poses_lengthT * sizeof(geographic_msgs::GeoPoseStamped)); + poses_length = poses_lengthT; + for( uint32_t i = 0; i < poses_length; i++){ + offset += this->st_poses.deserialize(inbuffer + offset); + memcpy( &(this->poses[i]), &(this->st_poses), sizeof(geographic_msgs::GeoPoseStamped)); + } + return offset; + } + + virtual const char * getType() override { return "geographic_msgs/GeoPath"; }; + virtual const char * getMD5() override { return "1476008e63041203a89257cfad97308f"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/geographic_msgs/GeoPoint.h b/pio_workspace/lib/ros_lib/geographic_msgs/GeoPoint.h new file mode 100644 index 0000000..eaf05af --- /dev/null +++ b/pio_workspace/lib/ros_lib/geographic_msgs/GeoPoint.h @@ -0,0 +1,53 @@ +#ifndef _ROS_geographic_msgs_GeoPoint_h +#define _ROS_geographic_msgs_GeoPoint_h + +#include +#include +#include +#include "ros/msg.h" + +namespace geographic_msgs +{ + + class GeoPoint : public ros::Msg + { + public: + typedef float _latitude_type; + _latitude_type latitude; + typedef float _longitude_type; + _longitude_type longitude; + typedef float _altitude_type; + _altitude_type altitude; + + GeoPoint(): + latitude(0), + longitude(0), + altitude(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->latitude); + offset += serializeAvrFloat64(outbuffer + offset, this->longitude); + offset += serializeAvrFloat64(outbuffer + offset, this->altitude); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->latitude)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->longitude)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->altitude)); + return offset; + } + + virtual const char * getType() override { return "geographic_msgs/GeoPoint"; }; + virtual const char * getMD5() override { return "c48027a852aeff972be80478ff38e81a"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/geographic_msgs/GeoPointStamped.h b/pio_workspace/lib/ros_lib/geographic_msgs/GeoPointStamped.h new file mode 100644 index 0000000..0d7f40b --- /dev/null +++ b/pio_workspace/lib/ros_lib/geographic_msgs/GeoPointStamped.h @@ -0,0 +1,50 @@ +#ifndef _ROS_geographic_msgs_GeoPointStamped_h +#define _ROS_geographic_msgs_GeoPointStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geographic_msgs/GeoPoint.h" + +namespace geographic_msgs +{ + + class GeoPointStamped : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef geographic_msgs::GeoPoint _position_type; + _position_type position; + + GeoPointStamped(): + header(), + position() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->position.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->position.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "geographic_msgs/GeoPointStamped"; }; + virtual const char * getMD5() override { return "ea50d268b03080563c330351a21edc89"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/geographic_msgs/GeoPose.h b/pio_workspace/lib/ros_lib/geographic_msgs/GeoPose.h new file mode 100644 index 0000000..a87ef84 --- /dev/null +++ b/pio_workspace/lib/ros_lib/geographic_msgs/GeoPose.h @@ -0,0 +1,50 @@ +#ifndef _ROS_geographic_msgs_GeoPose_h +#define _ROS_geographic_msgs_GeoPose_h + +#include +#include +#include +#include "ros/msg.h" +#include "geographic_msgs/GeoPoint.h" +#include "geometry_msgs/Quaternion.h" + +namespace geographic_msgs +{ + + class GeoPose : public ros::Msg + { + public: + typedef geographic_msgs::GeoPoint _position_type; + _position_type position; + typedef geometry_msgs::Quaternion _orientation_type; + _orientation_type orientation; + + GeoPose(): + position(), + orientation() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->position.serialize(outbuffer + offset); + offset += this->orientation.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->position.deserialize(inbuffer + offset); + offset += this->orientation.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "geographic_msgs/GeoPose"; }; + virtual const char * getMD5() override { return "778680b5172de58b7c057d973576c784"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/geographic_msgs/GeoPoseStamped.h b/pio_workspace/lib/ros_lib/geographic_msgs/GeoPoseStamped.h new file mode 100644 index 0000000..2d5e6e8 --- /dev/null +++ b/pio_workspace/lib/ros_lib/geographic_msgs/GeoPoseStamped.h @@ -0,0 +1,50 @@ +#ifndef _ROS_geographic_msgs_GeoPoseStamped_h +#define _ROS_geographic_msgs_GeoPoseStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geographic_msgs/GeoPose.h" + +namespace geographic_msgs +{ + + class GeoPoseStamped : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef geographic_msgs::GeoPose _pose_type; + _pose_type pose; + + GeoPoseStamped(): + header(), + pose() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->pose.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->pose.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "geographic_msgs/GeoPoseStamped"; }; + virtual const char * getMD5() override { return "cc409c8ed6064d8a846fa207bf3fba6b"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/geographic_msgs/GeographicMap.h b/pio_workspace/lib/ros_lib/geographic_msgs/GeographicMap.h new file mode 100644 index 0000000..cfbf7a6 --- /dev/null +++ b/pio_workspace/lib/ros_lib/geographic_msgs/GeographicMap.h @@ -0,0 +1,134 @@ +#ifndef _ROS_geographic_msgs_GeographicMap_h +#define _ROS_geographic_msgs_GeographicMap_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "uuid_msgs/UniqueID.h" +#include "geographic_msgs/BoundingBox.h" +#include "geographic_msgs/WayPoint.h" +#include "geographic_msgs/MapFeature.h" +#include "geographic_msgs/KeyValue.h" + +namespace geographic_msgs +{ + + class GeographicMap : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef uuid_msgs::UniqueID _id_type; + _id_type id; + typedef geographic_msgs::BoundingBox _bounds_type; + _bounds_type bounds; + uint32_t points_length; + typedef geographic_msgs::WayPoint _points_type; + _points_type st_points; + _points_type * points; + uint32_t features_length; + typedef geographic_msgs::MapFeature _features_type; + _features_type st_features; + _features_type * features; + uint32_t props_length; + typedef geographic_msgs::KeyValue _props_type; + _props_type st_props; + _props_type * props; + + GeographicMap(): + header(), + id(), + bounds(), + points_length(0), st_points(), points(nullptr), + features_length(0), st_features(), features(nullptr), + props_length(0), st_props(), props(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->id.serialize(outbuffer + offset); + offset += this->bounds.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->points_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->points_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->points_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->points_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->points_length); + for( uint32_t i = 0; i < points_length; i++){ + offset += this->points[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->features_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->features_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->features_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->features_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->features_length); + for( uint32_t i = 0; i < features_length; i++){ + offset += this->features[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->props_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->props_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->props_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->props_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->props_length); + for( uint32_t i = 0; i < props_length; i++){ + offset += this->props[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->id.deserialize(inbuffer + offset); + offset += this->bounds.deserialize(inbuffer + offset); + uint32_t points_lengthT = ((uint32_t) (*(inbuffer + offset))); + points_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + points_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + points_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->points_length); + if(points_lengthT > points_length) + this->points = (geographic_msgs::WayPoint*)realloc(this->points, points_lengthT * sizeof(geographic_msgs::WayPoint)); + points_length = points_lengthT; + for( uint32_t i = 0; i < points_length; i++){ + offset += this->st_points.deserialize(inbuffer + offset); + memcpy( &(this->points[i]), &(this->st_points), sizeof(geographic_msgs::WayPoint)); + } + uint32_t features_lengthT = ((uint32_t) (*(inbuffer + offset))); + features_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + features_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + features_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->features_length); + if(features_lengthT > features_length) + this->features = (geographic_msgs::MapFeature*)realloc(this->features, features_lengthT * sizeof(geographic_msgs::MapFeature)); + features_length = features_lengthT; + for( uint32_t i = 0; i < features_length; i++){ + offset += this->st_features.deserialize(inbuffer + offset); + memcpy( &(this->features[i]), &(this->st_features), sizeof(geographic_msgs::MapFeature)); + } + uint32_t props_lengthT = ((uint32_t) (*(inbuffer + offset))); + props_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + props_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + props_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->props_length); + if(props_lengthT > props_length) + this->props = (geographic_msgs::KeyValue*)realloc(this->props, props_lengthT * sizeof(geographic_msgs::KeyValue)); + props_length = props_lengthT; + for( uint32_t i = 0; i < props_length; i++){ + offset += this->st_props.deserialize(inbuffer + offset); + memcpy( &(this->props[i]), &(this->st_props), sizeof(geographic_msgs::KeyValue)); + } + return offset; + } + + virtual const char * getType() override { return "geographic_msgs/GeographicMap"; }; + virtual const char * getMD5() override { return "0f4ce6d2ebf9ac9c7c4f3308f6ae0731"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/geographic_msgs/GeographicMapChanges.h b/pio_workspace/lib/ros_lib/geographic_msgs/GeographicMapChanges.h new file mode 100644 index 0000000..a0368db --- /dev/null +++ b/pio_workspace/lib/ros_lib/geographic_msgs/GeographicMapChanges.h @@ -0,0 +1,76 @@ +#ifndef _ROS_geographic_msgs_GeographicMapChanges_h +#define _ROS_geographic_msgs_GeographicMapChanges_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geographic_msgs/GeographicMap.h" +#include "uuid_msgs/UniqueID.h" + +namespace geographic_msgs +{ + + class GeographicMapChanges : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef geographic_msgs::GeographicMap _diffs_type; + _diffs_type diffs; + uint32_t deletes_length; + typedef uuid_msgs::UniqueID _deletes_type; + _deletes_type st_deletes; + _deletes_type * deletes; + + GeographicMapChanges(): + header(), + diffs(), + deletes_length(0), st_deletes(), deletes(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->diffs.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->deletes_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->deletes_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->deletes_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->deletes_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->deletes_length); + for( uint32_t i = 0; i < deletes_length; i++){ + offset += this->deletes[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->diffs.deserialize(inbuffer + offset); + uint32_t deletes_lengthT = ((uint32_t) (*(inbuffer + offset))); + deletes_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + deletes_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + deletes_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->deletes_length); + if(deletes_lengthT > deletes_length) + this->deletes = (uuid_msgs::UniqueID*)realloc(this->deletes, deletes_lengthT * sizeof(uuid_msgs::UniqueID)); + deletes_length = deletes_lengthT; + for( uint32_t i = 0; i < deletes_length; i++){ + offset += this->st_deletes.deserialize(inbuffer + offset); + memcpy( &(this->deletes[i]), &(this->st_deletes), sizeof(uuid_msgs::UniqueID)); + } + return offset; + } + + virtual const char * getType() override { return "geographic_msgs/GeographicMapChanges"; }; + virtual const char * getMD5() override { return "4fd027f54298203ec12aa1c4b20e6cb8"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/geographic_msgs/GetGeoPath.h b/pio_workspace/lib/ros_lib/geographic_msgs/GetGeoPath.h new file mode 100644 index 0000000..272a2ea --- /dev/null +++ b/pio_workspace/lib/ros_lib/geographic_msgs/GetGeoPath.h @@ -0,0 +1,143 @@ +#ifndef _ROS_SERVICE_GetGeoPath_h +#define _ROS_SERVICE_GetGeoPath_h +#include +#include +#include +#include "ros/msg.h" +#include "geographic_msgs/GeoPoint.h" +#include "geographic_msgs/GeoPath.h" +#include "uuid_msgs/UniqueID.h" + +namespace geographic_msgs +{ + +static const char GETGEOPATH[] = "geographic_msgs/GetGeoPath"; + + class GetGeoPathRequest : public ros::Msg + { + public: + typedef geographic_msgs::GeoPoint _start_type; + _start_type start; + typedef geographic_msgs::GeoPoint _goal_type; + _goal_type goal; + + GetGeoPathRequest(): + start(), + goal() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->start.serialize(outbuffer + offset); + offset += this->goal.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->start.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return GETGEOPATH; }; + virtual const char * getMD5() override { return "cad6de11e4ae4ca568785186e1f99f89"; }; + + }; + + class GetGeoPathResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + typedef const char* _status_type; + _status_type status; + typedef geographic_msgs::GeoPath _plan_type; + _plan_type plan; + typedef uuid_msgs::UniqueID _network_type; + _network_type network; + typedef uuid_msgs::UniqueID _start_seg_type; + _start_seg_type start_seg; + typedef uuid_msgs::UniqueID _goal_seg_type; + _goal_seg_type goal_seg; + typedef float _distance_type; + _distance_type distance; + + GetGeoPathResponse(): + success(0), + status(""), + plan(), + network(), + start_seg(), + goal_seg(), + distance(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status = strlen(this->status); + varToArr(outbuffer + offset, length_status); + offset += 4; + memcpy(outbuffer + offset, this->status, length_status); + offset += length_status; + offset += this->plan.serialize(outbuffer + offset); + offset += this->network.serialize(outbuffer + offset); + offset += this->start_seg.serialize(outbuffer + offset); + offset += this->goal_seg.serialize(outbuffer + offset); + offset += serializeAvrFloat64(outbuffer + offset, this->distance); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status; + arrToVar(length_status, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status-1]=0; + this->status = (char *)(inbuffer + offset-1); + offset += length_status; + offset += this->plan.deserialize(inbuffer + offset); + offset += this->network.deserialize(inbuffer + offset); + offset += this->start_seg.deserialize(inbuffer + offset); + offset += this->goal_seg.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->distance)); + return offset; + } + + virtual const char * getType() override { return GETGEOPATH; }; + virtual const char * getMD5() override { return "0562f4b72e4d5b8e5fa142bd7363638c"; }; + + }; + + class GetGeoPath { + public: + typedef GetGeoPathRequest Request; + typedef GetGeoPathResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/geographic_msgs/GetGeographicMap.h b/pio_workspace/lib/ros_lib/geographic_msgs/GetGeographicMap.h new file mode 100644 index 0000000..ccb1587 --- /dev/null +++ b/pio_workspace/lib/ros_lib/geographic_msgs/GetGeographicMap.h @@ -0,0 +1,134 @@ +#ifndef _ROS_SERVICE_GetGeographicMap_h +#define _ROS_SERVICE_GetGeographicMap_h +#include +#include +#include +#include "ros/msg.h" +#include "geographic_msgs/BoundingBox.h" +#include "geographic_msgs/GeographicMap.h" + +namespace geographic_msgs +{ + +static const char GETGEOGRAPHICMAP[] = "geographic_msgs/GetGeographicMap"; + + class GetGeographicMapRequest : public ros::Msg + { + public: + typedef const char* _url_type; + _url_type url; + typedef geographic_msgs::BoundingBox _bounds_type; + _bounds_type bounds; + + GetGeographicMapRequest(): + url(""), + bounds() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_url = strlen(this->url); + varToArr(outbuffer + offset, length_url); + offset += 4; + memcpy(outbuffer + offset, this->url, length_url); + offset += length_url; + offset += this->bounds.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_url; + arrToVar(length_url, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_url; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_url-1]=0; + this->url = (char *)(inbuffer + offset-1); + offset += length_url; + offset += this->bounds.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return GETGEOGRAPHICMAP; }; + virtual const char * getMD5() override { return "505cc89008cb1745810d2ee4ea646d6e"; }; + + }; + + class GetGeographicMapResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + typedef const char* _status_type; + _status_type status; + typedef geographic_msgs::GeographicMap _map_type; + _map_type map; + + GetGeographicMapResponse(): + success(0), + status(""), + map() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status = strlen(this->status); + varToArr(outbuffer + offset, length_status); + offset += 4; + memcpy(outbuffer + offset, this->status, length_status); + offset += length_status; + offset += this->map.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status; + arrToVar(length_status, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status-1]=0; + this->status = (char *)(inbuffer + offset-1); + offset += length_status; + offset += this->map.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return GETGEOGRAPHICMAP; }; + virtual const char * getMD5() override { return "0910332806c65953a4f4252eb780811a"; }; + + }; + + class GetGeographicMap { + public: + typedef GetGeographicMapRequest Request; + typedef GetGeographicMapResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/geographic_msgs/GetRoutePlan.h b/pio_workspace/lib/ros_lib/geographic_msgs/GetRoutePlan.h new file mode 100644 index 0000000..3b8942f --- /dev/null +++ b/pio_workspace/lib/ros_lib/geographic_msgs/GetRoutePlan.h @@ -0,0 +1,127 @@ +#ifndef _ROS_SERVICE_GetRoutePlan_h +#define _ROS_SERVICE_GetRoutePlan_h +#include +#include +#include +#include "ros/msg.h" +#include "geographic_msgs/RoutePath.h" +#include "uuid_msgs/UniqueID.h" + +namespace geographic_msgs +{ + +static const char GETROUTEPLAN[] = "geographic_msgs/GetRoutePlan"; + + class GetRoutePlanRequest : public ros::Msg + { + public: + typedef uuid_msgs::UniqueID _network_type; + _network_type network; + typedef uuid_msgs::UniqueID _start_type; + _start_type start; + typedef uuid_msgs::UniqueID _goal_type; + _goal_type goal; + + GetRoutePlanRequest(): + network(), + start(), + goal() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->network.serialize(outbuffer + offset); + offset += this->start.serialize(outbuffer + offset); + offset += this->goal.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->network.deserialize(inbuffer + offset); + offset += this->start.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return GETROUTEPLAN; }; + virtual const char * getMD5() override { return "e56ac34268c6d575dabb30f42da4a47a"; }; + + }; + + class GetRoutePlanResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + typedef const char* _status_type; + _status_type status; + typedef geographic_msgs::RoutePath _plan_type; + _plan_type plan; + + GetRoutePlanResponse(): + success(0), + status(""), + plan() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status = strlen(this->status); + varToArr(outbuffer + offset, length_status); + offset += 4; + memcpy(outbuffer + offset, this->status, length_status); + offset += length_status; + offset += this->plan.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status; + arrToVar(length_status, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status-1]=0; + this->status = (char *)(inbuffer + offset-1); + offset += length_status; + offset += this->plan.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return GETROUTEPLAN; }; + virtual const char * getMD5() override { return "28ee54f0ccb2ab28b46048ebc6fa5aff"; }; + + }; + + class GetRoutePlan { + public: + typedef GetRoutePlanRequest Request; + typedef GetRoutePlanResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/geographic_msgs/KeyValue.h b/pio_workspace/lib/ros_lib/geographic_msgs/KeyValue.h new file mode 100644 index 0000000..8ef9190 --- /dev/null +++ b/pio_workspace/lib/ros_lib/geographic_msgs/KeyValue.h @@ -0,0 +1,72 @@ +#ifndef _ROS_geographic_msgs_KeyValue_h +#define _ROS_geographic_msgs_KeyValue_h + +#include +#include +#include +#include "ros/msg.h" + +namespace geographic_msgs +{ + + class KeyValue : public ros::Msg + { + public: + typedef const char* _key_type; + _key_type key; + typedef const char* _value_type; + _value_type value; + + KeyValue(): + key(""), + value("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_key = strlen(this->key); + varToArr(outbuffer + offset, length_key); + offset += 4; + memcpy(outbuffer + offset, this->key, length_key); + offset += length_key; + uint32_t length_value = strlen(this->value); + varToArr(outbuffer + offset, length_value); + offset += 4; + memcpy(outbuffer + offset, this->value, length_value); + offset += length_value; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_key; + arrToVar(length_key, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_key; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_key-1]=0; + this->key = (char *)(inbuffer + offset-1); + offset += length_key; + uint32_t length_value; + arrToVar(length_value, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_value; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_value-1]=0; + this->value = (char *)(inbuffer + offset-1); + offset += length_value; + return offset; + } + + virtual const char * getType() override { return "geographic_msgs/KeyValue"; }; + virtual const char * getMD5() override { return "cf57fdc6617a881a88c16e768132149c"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/geographic_msgs/MapFeature.h b/pio_workspace/lib/ros_lib/geographic_msgs/MapFeature.h new file mode 100644 index 0000000..bfd10c4 --- /dev/null +++ b/pio_workspace/lib/ros_lib/geographic_msgs/MapFeature.h @@ -0,0 +1,95 @@ +#ifndef _ROS_geographic_msgs_MapFeature_h +#define _ROS_geographic_msgs_MapFeature_h + +#include +#include +#include +#include "ros/msg.h" +#include "uuid_msgs/UniqueID.h" +#include "geographic_msgs/KeyValue.h" + +namespace geographic_msgs +{ + + class MapFeature : public ros::Msg + { + public: + typedef uuid_msgs::UniqueID _id_type; + _id_type id; + uint32_t components_length; + typedef uuid_msgs::UniqueID _components_type; + _components_type st_components; + _components_type * components; + uint32_t props_length; + typedef geographic_msgs::KeyValue _props_type; + _props_type st_props; + _props_type * props; + + MapFeature(): + id(), + components_length(0), st_components(), components(nullptr), + props_length(0), st_props(), props(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->id.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->components_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->components_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->components_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->components_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->components_length); + for( uint32_t i = 0; i < components_length; i++){ + offset += this->components[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->props_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->props_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->props_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->props_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->props_length); + for( uint32_t i = 0; i < props_length; i++){ + offset += this->props[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->id.deserialize(inbuffer + offset); + uint32_t components_lengthT = ((uint32_t) (*(inbuffer + offset))); + components_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + components_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + components_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->components_length); + if(components_lengthT > components_length) + this->components = (uuid_msgs::UniqueID*)realloc(this->components, components_lengthT * sizeof(uuid_msgs::UniqueID)); + components_length = components_lengthT; + for( uint32_t i = 0; i < components_length; i++){ + offset += this->st_components.deserialize(inbuffer + offset); + memcpy( &(this->components[i]), &(this->st_components), sizeof(uuid_msgs::UniqueID)); + } + uint32_t props_lengthT = ((uint32_t) (*(inbuffer + offset))); + props_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + props_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + props_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->props_length); + if(props_lengthT > props_length) + this->props = (geographic_msgs::KeyValue*)realloc(this->props, props_lengthT * sizeof(geographic_msgs::KeyValue)); + props_length = props_lengthT; + for( uint32_t i = 0; i < props_length; i++){ + offset += this->st_props.deserialize(inbuffer + offset); + memcpy( &(this->props[i]), &(this->st_props), sizeof(geographic_msgs::KeyValue)); + } + return offset; + } + + virtual const char * getType() override { return "geographic_msgs/MapFeature"; }; + virtual const char * getMD5() override { return "e2505ace5e8da8a15b610eaf62bdefae"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/geographic_msgs/RouteNetwork.h b/pio_workspace/lib/ros_lib/geographic_msgs/RouteNetwork.h new file mode 100644 index 0000000..5390dac --- /dev/null +++ b/pio_workspace/lib/ros_lib/geographic_msgs/RouteNetwork.h @@ -0,0 +1,134 @@ +#ifndef _ROS_geographic_msgs_RouteNetwork_h +#define _ROS_geographic_msgs_RouteNetwork_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "uuid_msgs/UniqueID.h" +#include "geographic_msgs/BoundingBox.h" +#include "geographic_msgs/WayPoint.h" +#include "geographic_msgs/RouteSegment.h" +#include "geographic_msgs/KeyValue.h" + +namespace geographic_msgs +{ + + class RouteNetwork : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef uuid_msgs::UniqueID _id_type; + _id_type id; + typedef geographic_msgs::BoundingBox _bounds_type; + _bounds_type bounds; + uint32_t points_length; + typedef geographic_msgs::WayPoint _points_type; + _points_type st_points; + _points_type * points; + uint32_t segments_length; + typedef geographic_msgs::RouteSegment _segments_type; + _segments_type st_segments; + _segments_type * segments; + uint32_t props_length; + typedef geographic_msgs::KeyValue _props_type; + _props_type st_props; + _props_type * props; + + RouteNetwork(): + header(), + id(), + bounds(), + points_length(0), st_points(), points(nullptr), + segments_length(0), st_segments(), segments(nullptr), + props_length(0), st_props(), props(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->id.serialize(outbuffer + offset); + offset += this->bounds.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->points_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->points_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->points_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->points_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->points_length); + for( uint32_t i = 0; i < points_length; i++){ + offset += this->points[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->segments_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->segments_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->segments_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->segments_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->segments_length); + for( uint32_t i = 0; i < segments_length; i++){ + offset += this->segments[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->props_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->props_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->props_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->props_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->props_length); + for( uint32_t i = 0; i < props_length; i++){ + offset += this->props[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->id.deserialize(inbuffer + offset); + offset += this->bounds.deserialize(inbuffer + offset); + uint32_t points_lengthT = ((uint32_t) (*(inbuffer + offset))); + points_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + points_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + points_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->points_length); + if(points_lengthT > points_length) + this->points = (geographic_msgs::WayPoint*)realloc(this->points, points_lengthT * sizeof(geographic_msgs::WayPoint)); + points_length = points_lengthT; + for( uint32_t i = 0; i < points_length; i++){ + offset += this->st_points.deserialize(inbuffer + offset); + memcpy( &(this->points[i]), &(this->st_points), sizeof(geographic_msgs::WayPoint)); + } + uint32_t segments_lengthT = ((uint32_t) (*(inbuffer + offset))); + segments_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + segments_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + segments_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->segments_length); + if(segments_lengthT > segments_length) + this->segments = (geographic_msgs::RouteSegment*)realloc(this->segments, segments_lengthT * sizeof(geographic_msgs::RouteSegment)); + segments_length = segments_lengthT; + for( uint32_t i = 0; i < segments_length; i++){ + offset += this->st_segments.deserialize(inbuffer + offset); + memcpy( &(this->segments[i]), &(this->st_segments), sizeof(geographic_msgs::RouteSegment)); + } + uint32_t props_lengthT = ((uint32_t) (*(inbuffer + offset))); + props_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + props_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + props_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->props_length); + if(props_lengthT > props_length) + this->props = (geographic_msgs::KeyValue*)realloc(this->props, props_lengthT * sizeof(geographic_msgs::KeyValue)); + props_length = props_lengthT; + for( uint32_t i = 0; i < props_length; i++){ + offset += this->st_props.deserialize(inbuffer + offset); + memcpy( &(this->props[i]), &(this->st_props), sizeof(geographic_msgs::KeyValue)); + } + return offset; + } + + virtual const char * getType() override { return "geographic_msgs/RouteNetwork"; }; + virtual const char * getMD5() override { return "fd717c0a34a7c954deed32c6847f30a8"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/geographic_msgs/RoutePath.h b/pio_workspace/lib/ros_lib/geographic_msgs/RoutePath.h new file mode 100644 index 0000000..8a9371c --- /dev/null +++ b/pio_workspace/lib/ros_lib/geographic_msgs/RoutePath.h @@ -0,0 +1,101 @@ +#ifndef _ROS_geographic_msgs_RoutePath_h +#define _ROS_geographic_msgs_RoutePath_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "uuid_msgs/UniqueID.h" +#include "geographic_msgs/KeyValue.h" + +namespace geographic_msgs +{ + + class RoutePath : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef uuid_msgs::UniqueID _network_type; + _network_type network; + uint32_t segments_length; + typedef uuid_msgs::UniqueID _segments_type; + _segments_type st_segments; + _segments_type * segments; + uint32_t props_length; + typedef geographic_msgs::KeyValue _props_type; + _props_type st_props; + _props_type * props; + + RoutePath(): + header(), + network(), + segments_length(0), st_segments(), segments(nullptr), + props_length(0), st_props(), props(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->network.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->segments_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->segments_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->segments_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->segments_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->segments_length); + for( uint32_t i = 0; i < segments_length; i++){ + offset += this->segments[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->props_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->props_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->props_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->props_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->props_length); + for( uint32_t i = 0; i < props_length; i++){ + offset += this->props[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->network.deserialize(inbuffer + offset); + uint32_t segments_lengthT = ((uint32_t) (*(inbuffer + offset))); + segments_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + segments_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + segments_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->segments_length); + if(segments_lengthT > segments_length) + this->segments = (uuid_msgs::UniqueID*)realloc(this->segments, segments_lengthT * sizeof(uuid_msgs::UniqueID)); + segments_length = segments_lengthT; + for( uint32_t i = 0; i < segments_length; i++){ + offset += this->st_segments.deserialize(inbuffer + offset); + memcpy( &(this->segments[i]), &(this->st_segments), sizeof(uuid_msgs::UniqueID)); + } + uint32_t props_lengthT = ((uint32_t) (*(inbuffer + offset))); + props_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + props_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + props_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->props_length); + if(props_lengthT > props_length) + this->props = (geographic_msgs::KeyValue*)realloc(this->props, props_lengthT * sizeof(geographic_msgs::KeyValue)); + props_length = props_lengthT; + for( uint32_t i = 0; i < props_length; i++){ + offset += this->st_props.deserialize(inbuffer + offset); + memcpy( &(this->props[i]), &(this->st_props), sizeof(geographic_msgs::KeyValue)); + } + return offset; + } + + virtual const char * getType() override { return "geographic_msgs/RoutePath"; }; + virtual const char * getMD5() override { return "0aa2dd809a8091bdb4466dfefecbb8cf"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/geographic_msgs/RouteSegment.h b/pio_workspace/lib/ros_lib/geographic_msgs/RouteSegment.h new file mode 100644 index 0000000..83b1e87 --- /dev/null +++ b/pio_workspace/lib/ros_lib/geographic_msgs/RouteSegment.h @@ -0,0 +1,80 @@ +#ifndef _ROS_geographic_msgs_RouteSegment_h +#define _ROS_geographic_msgs_RouteSegment_h + +#include +#include +#include +#include "ros/msg.h" +#include "uuid_msgs/UniqueID.h" +#include "geographic_msgs/KeyValue.h" + +namespace geographic_msgs +{ + + class RouteSegment : public ros::Msg + { + public: + typedef uuid_msgs::UniqueID _id_type; + _id_type id; + typedef uuid_msgs::UniqueID _start_type; + _start_type start; + typedef uuid_msgs::UniqueID _end_type; + _end_type end; + uint32_t props_length; + typedef geographic_msgs::KeyValue _props_type; + _props_type st_props; + _props_type * props; + + RouteSegment(): + id(), + start(), + end(), + props_length(0), st_props(), props(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->id.serialize(outbuffer + offset); + offset += this->start.serialize(outbuffer + offset); + offset += this->end.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->props_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->props_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->props_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->props_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->props_length); + for( uint32_t i = 0; i < props_length; i++){ + offset += this->props[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->id.deserialize(inbuffer + offset); + offset += this->start.deserialize(inbuffer + offset); + offset += this->end.deserialize(inbuffer + offset); + uint32_t props_lengthT = ((uint32_t) (*(inbuffer + offset))); + props_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + props_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + props_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->props_length); + if(props_lengthT > props_length) + this->props = (geographic_msgs::KeyValue*)realloc(this->props, props_lengthT * sizeof(geographic_msgs::KeyValue)); + props_length = props_lengthT; + for( uint32_t i = 0; i < props_length; i++){ + offset += this->st_props.deserialize(inbuffer + offset); + memcpy( &(this->props[i]), &(this->st_props), sizeof(geographic_msgs::KeyValue)); + } + return offset; + } + + virtual const char * getType() override { return "geographic_msgs/RouteSegment"; }; + virtual const char * getMD5() override { return "8583d1e2ddf1891c3934a5d2ed9a799c"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/geographic_msgs/UpdateGeographicMap.h b/pio_workspace/lib/ros_lib/geographic_msgs/UpdateGeographicMap.h new file mode 100644 index 0000000..b0122ed --- /dev/null +++ b/pio_workspace/lib/ros_lib/geographic_msgs/UpdateGeographicMap.h @@ -0,0 +1,111 @@ +#ifndef _ROS_SERVICE_UpdateGeographicMap_h +#define _ROS_SERVICE_UpdateGeographicMap_h +#include +#include +#include +#include "ros/msg.h" +#include "geographic_msgs/GeographicMapChanges.h" + +namespace geographic_msgs +{ + +static const char UPDATEGEOGRAPHICMAP[] = "geographic_msgs/UpdateGeographicMap"; + + class UpdateGeographicMapRequest : public ros::Msg + { + public: + typedef geographic_msgs::GeographicMapChanges _updates_type; + _updates_type updates; + + UpdateGeographicMapRequest(): + updates() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->updates.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->updates.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return UPDATEGEOGRAPHICMAP; }; + virtual const char * getMD5() override { return "8d8da723a1fadc5f7621a18b4e72fc3b"; }; + + }; + + class UpdateGeographicMapResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + typedef const char* _status_type; + _status_type status; + + UpdateGeographicMapResponse(): + success(0), + status("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status = strlen(this->status); + varToArr(outbuffer + offset, length_status); + offset += 4; + memcpy(outbuffer + offset, this->status, length_status); + offset += length_status; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status; + arrToVar(length_status, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status-1]=0; + this->status = (char *)(inbuffer + offset-1); + offset += length_status; + return offset; + } + + virtual const char * getType() override { return UPDATEGEOGRAPHICMAP; }; + virtual const char * getMD5() override { return "38b8954d32a849f31d78416b12bff5d1"; }; + + }; + + class UpdateGeographicMap { + public: + typedef UpdateGeographicMapRequest Request; + typedef UpdateGeographicMapResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/geographic_msgs/WayPoint.h b/pio_workspace/lib/ros_lib/geographic_msgs/WayPoint.h new file mode 100644 index 0000000..9c71b3d --- /dev/null +++ b/pio_workspace/lib/ros_lib/geographic_msgs/WayPoint.h @@ -0,0 +1,76 @@ +#ifndef _ROS_geographic_msgs_WayPoint_h +#define _ROS_geographic_msgs_WayPoint_h + +#include +#include +#include +#include "ros/msg.h" +#include "uuid_msgs/UniqueID.h" +#include "geographic_msgs/GeoPoint.h" +#include "geographic_msgs/KeyValue.h" + +namespace geographic_msgs +{ + + class WayPoint : public ros::Msg + { + public: + typedef uuid_msgs::UniqueID _id_type; + _id_type id; + typedef geographic_msgs::GeoPoint _position_type; + _position_type position; + uint32_t props_length; + typedef geographic_msgs::KeyValue _props_type; + _props_type st_props; + _props_type * props; + + WayPoint(): + id(), + position(), + props_length(0), st_props(), props(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->id.serialize(outbuffer + offset); + offset += this->position.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->props_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->props_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->props_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->props_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->props_length); + for( uint32_t i = 0; i < props_length; i++){ + offset += this->props[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->id.deserialize(inbuffer + offset); + offset += this->position.deserialize(inbuffer + offset); + uint32_t props_lengthT = ((uint32_t) (*(inbuffer + offset))); + props_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + props_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + props_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->props_length); + if(props_lengthT > props_length) + this->props = (geographic_msgs::KeyValue*)realloc(this->props, props_lengthT * sizeof(geographic_msgs::KeyValue)); + props_length = props_lengthT; + for( uint32_t i = 0; i < props_length; i++){ + offset += this->st_props.deserialize(inbuffer + offset); + memcpy( &(this->props[i]), &(this->st_props), sizeof(geographic_msgs::KeyValue)); + } + return offset; + } + + virtual const char * getType() override { return "geographic_msgs/WayPoint"; }; + virtual const char * getMD5() override { return "ef04f823aef332455a49eaec3f1761b7"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/grid_map_msgs/GetGridMap.h b/pio_workspace/lib/ros_lib/grid_map_msgs/GetGridMap.h new file mode 100644 index 0000000..6d3a02d --- /dev/null +++ b/pio_workspace/lib/ros_lib/grid_map_msgs/GetGridMap.h @@ -0,0 +1,150 @@ +#ifndef _ROS_SERVICE_GetGridMap_h +#define _ROS_SERVICE_GetGridMap_h +#include +#include +#include +#include "ros/msg.h" +#include "grid_map_msgs/GridMap.h" + +namespace grid_map_msgs +{ + +static const char GETGRIDMAP[] = "grid_map_msgs/GetGridMap"; + + class GetGridMapRequest : public ros::Msg + { + public: + typedef const char* _frame_id_type; + _frame_id_type frame_id; + typedef float _position_x_type; + _position_x_type position_x; + typedef float _position_y_type; + _position_y_type position_y; + typedef float _length_x_type; + _length_x_type length_x; + typedef float _length_y_type; + _length_y_type length_y; + uint32_t layers_length; + typedef char* _layers_type; + _layers_type st_layers; + _layers_type * layers; + + GetGridMapRequest(): + frame_id(""), + position_x(0), + position_y(0), + length_x(0), + length_y(0), + layers_length(0), st_layers(), layers(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_frame_id = strlen(this->frame_id); + varToArr(outbuffer + offset, length_frame_id); + offset += 4; + memcpy(outbuffer + offset, this->frame_id, length_frame_id); + offset += length_frame_id; + offset += serializeAvrFloat64(outbuffer + offset, this->position_x); + offset += serializeAvrFloat64(outbuffer + offset, this->position_y); + offset += serializeAvrFloat64(outbuffer + offset, this->length_x); + offset += serializeAvrFloat64(outbuffer + offset, this->length_y); + *(outbuffer + offset + 0) = (this->layers_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->layers_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->layers_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->layers_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->layers_length); + for( uint32_t i = 0; i < layers_length; i++){ + uint32_t length_layersi = strlen(this->layers[i]); + varToArr(outbuffer + offset, length_layersi); + offset += 4; + memcpy(outbuffer + offset, this->layers[i], length_layersi); + offset += length_layersi; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_frame_id; + arrToVar(length_frame_id, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_frame_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_frame_id-1]=0; + this->frame_id = (char *)(inbuffer + offset-1); + offset += length_frame_id; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->position_x)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->position_y)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->length_x)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->length_y)); + uint32_t layers_lengthT = ((uint32_t) (*(inbuffer + offset))); + layers_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + layers_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + layers_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->layers_length); + if(layers_lengthT > layers_length) + this->layers = (char**)realloc(this->layers, layers_lengthT * sizeof(char*)); + layers_length = layers_lengthT; + for( uint32_t i = 0; i < layers_length; i++){ + uint32_t length_st_layers; + arrToVar(length_st_layers, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_layers; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_layers-1]=0; + this->st_layers = (char *)(inbuffer + offset-1); + offset += length_st_layers; + memcpy( &(this->layers[i]), &(this->st_layers), sizeof(char*)); + } + return offset; + } + + virtual const char * getType() override { return GETGRIDMAP; }; + virtual const char * getMD5() override { return "b6b21ecd617fdfa7f32e8c349cec3c2e"; }; + + }; + + class GetGridMapResponse : public ros::Msg + { + public: + typedef grid_map_msgs::GridMap _map_type; + _map_type map; + + GetGridMapResponse(): + map() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->map.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->map.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return GETGRIDMAP; }; + virtual const char * getMD5() override { return "4f8e24cfd42bc1470fe765b7516ff7e5"; }; + + }; + + class GetGridMap { + public: + typedef GetGridMapRequest Request; + typedef GetGridMapResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/grid_map_msgs/GetGridMapInfo.h b/pio_workspace/lib/ros_lib/grid_map_msgs/GetGridMapInfo.h new file mode 100644 index 0000000..7bd65b2 --- /dev/null +++ b/pio_workspace/lib/ros_lib/grid_map_msgs/GetGridMapInfo.h @@ -0,0 +1,76 @@ +#ifndef _ROS_SERVICE_GetGridMapInfo_h +#define _ROS_SERVICE_GetGridMapInfo_h +#include +#include +#include +#include "ros/msg.h" +#include "grid_map_msgs/GridMapInfo.h" + +namespace grid_map_msgs +{ + +static const char GETGRIDMAPINFO[] = "grid_map_msgs/GetGridMapInfo"; + + class GetGridMapInfoRequest : public ros::Msg + { + public: + + GetGridMapInfoRequest() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + return offset; + } + + virtual const char * getType() override { return GETGRIDMAPINFO; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class GetGridMapInfoResponse : public ros::Msg + { + public: + typedef grid_map_msgs::GridMapInfo _info_type; + _info_type info; + + GetGridMapInfoResponse(): + info() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->info.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->info.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return GETGRIDMAPINFO; }; + virtual const char * getMD5() override { return "a0be1719725f7fd7b490db4d64321ff2"; }; + + }; + + class GetGridMapInfo { + public: + typedef GetGridMapInfoRequest Request; + typedef GetGridMapInfoResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/grid_map_msgs/GridMap.h b/pio_workspace/lib/ros_lib/grid_map_msgs/GridMap.h new file mode 100644 index 0000000..388d999 --- /dev/null +++ b/pio_workspace/lib/ros_lib/grid_map_msgs/GridMap.h @@ -0,0 +1,162 @@ +#ifndef _ROS_grid_map_msgs_GridMap_h +#define _ROS_grid_map_msgs_GridMap_h + +#include +#include +#include +#include "ros/msg.h" +#include "grid_map_msgs/GridMapInfo.h" +#include "std_msgs/Float32MultiArray.h" + +namespace grid_map_msgs +{ + + class GridMap : public ros::Msg + { + public: + typedef grid_map_msgs::GridMapInfo _info_type; + _info_type info; + uint32_t layers_length; + typedef char* _layers_type; + _layers_type st_layers; + _layers_type * layers; + uint32_t basic_layers_length; + typedef char* _basic_layers_type; + _basic_layers_type st_basic_layers; + _basic_layers_type * basic_layers; + uint32_t data_length; + typedef std_msgs::Float32MultiArray _data_type; + _data_type st_data; + _data_type * data; + typedef uint16_t _outer_start_index_type; + _outer_start_index_type outer_start_index; + typedef uint16_t _inner_start_index_type; + _inner_start_index_type inner_start_index; + + GridMap(): + info(), + layers_length(0), st_layers(), layers(nullptr), + basic_layers_length(0), st_basic_layers(), basic_layers(nullptr), + data_length(0), st_data(), data(nullptr), + outer_start_index(0), + inner_start_index(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->info.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->layers_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->layers_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->layers_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->layers_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->layers_length); + for( uint32_t i = 0; i < layers_length; i++){ + uint32_t length_layersi = strlen(this->layers[i]); + varToArr(outbuffer + offset, length_layersi); + offset += 4; + memcpy(outbuffer + offset, this->layers[i], length_layersi); + offset += length_layersi; + } + *(outbuffer + offset + 0) = (this->basic_layers_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->basic_layers_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->basic_layers_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->basic_layers_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->basic_layers_length); + for( uint32_t i = 0; i < basic_layers_length; i++){ + uint32_t length_basic_layersi = strlen(this->basic_layers[i]); + varToArr(outbuffer + offset, length_basic_layersi); + offset += 4; + memcpy(outbuffer + offset, this->basic_layers[i], length_basic_layersi); + offset += length_basic_layersi; + } + *(outbuffer + offset + 0) = (this->data_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->data_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->data_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->data_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->data_length); + for( uint32_t i = 0; i < data_length; i++){ + offset += this->data[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->outer_start_index >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->outer_start_index >> (8 * 1)) & 0xFF; + offset += sizeof(this->outer_start_index); + *(outbuffer + offset + 0) = (this->inner_start_index >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->inner_start_index >> (8 * 1)) & 0xFF; + offset += sizeof(this->inner_start_index); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->info.deserialize(inbuffer + offset); + uint32_t layers_lengthT = ((uint32_t) (*(inbuffer + offset))); + layers_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + layers_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + layers_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->layers_length); + if(layers_lengthT > layers_length) + this->layers = (char**)realloc(this->layers, layers_lengthT * sizeof(char*)); + layers_length = layers_lengthT; + for( uint32_t i = 0; i < layers_length; i++){ + uint32_t length_st_layers; + arrToVar(length_st_layers, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_layers; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_layers-1]=0; + this->st_layers = (char *)(inbuffer + offset-1); + offset += length_st_layers; + memcpy( &(this->layers[i]), &(this->st_layers), sizeof(char*)); + } + uint32_t basic_layers_lengthT = ((uint32_t) (*(inbuffer + offset))); + basic_layers_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + basic_layers_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + basic_layers_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->basic_layers_length); + if(basic_layers_lengthT > basic_layers_length) + this->basic_layers = (char**)realloc(this->basic_layers, basic_layers_lengthT * sizeof(char*)); + basic_layers_length = basic_layers_lengthT; + for( uint32_t i = 0; i < basic_layers_length; i++){ + uint32_t length_st_basic_layers; + arrToVar(length_st_basic_layers, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_basic_layers; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_basic_layers-1]=0; + this->st_basic_layers = (char *)(inbuffer + offset-1); + offset += length_st_basic_layers; + memcpy( &(this->basic_layers[i]), &(this->st_basic_layers), sizeof(char*)); + } + uint32_t data_lengthT = ((uint32_t) (*(inbuffer + offset))); + data_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + data_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + data_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->data_length); + if(data_lengthT > data_length) + this->data = (std_msgs::Float32MultiArray*)realloc(this->data, data_lengthT * sizeof(std_msgs::Float32MultiArray)); + data_length = data_lengthT; + for( uint32_t i = 0; i < data_length; i++){ + offset += this->st_data.deserialize(inbuffer + offset); + memcpy( &(this->data[i]), &(this->st_data), sizeof(std_msgs::Float32MultiArray)); + } + this->outer_start_index = ((uint16_t) (*(inbuffer + offset))); + this->outer_start_index |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->outer_start_index); + this->inner_start_index = ((uint16_t) (*(inbuffer + offset))); + this->inner_start_index |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->inner_start_index); + return offset; + } + + virtual const char * getType() override { return "grid_map_msgs/GridMap"; }; + virtual const char * getMD5() override { return "95681e052b1f73bf87b7eb984382b401"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/grid_map_msgs/GridMapInfo.h b/pio_workspace/lib/ros_lib/grid_map_msgs/GridMapInfo.h new file mode 100644 index 0000000..938556a --- /dev/null +++ b/pio_workspace/lib/ros_lib/grid_map_msgs/GridMapInfo.h @@ -0,0 +1,65 @@ +#ifndef _ROS_grid_map_msgs_GridMapInfo_h +#define _ROS_grid_map_msgs_GridMapInfo_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Pose.h" + +namespace grid_map_msgs +{ + + class GridMapInfo : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef float _resolution_type; + _resolution_type resolution; + typedef float _length_x_type; + _length_x_type length_x; + typedef float _length_y_type; + _length_y_type length_y; + typedef geometry_msgs::Pose _pose_type; + _pose_type pose; + + GridMapInfo(): + header(), + resolution(0), + length_x(0), + length_y(0), + pose() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += serializeAvrFloat64(outbuffer + offset, this->resolution); + offset += serializeAvrFloat64(outbuffer + offset, this->length_x); + offset += serializeAvrFloat64(outbuffer + offset, this->length_y); + offset += this->pose.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->resolution)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->length_x)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->length_y)); + offset += this->pose.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "grid_map_msgs/GridMapInfo"; }; + virtual const char * getMD5() override { return "43ee5430e1c253682111cb6bedac0ef9"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/grid_map_msgs/ProcessFile.h b/pio_workspace/lib/ros_lib/grid_map_msgs/ProcessFile.h new file mode 100644 index 0000000..db48ae7 --- /dev/null +++ b/pio_workspace/lib/ros_lib/grid_map_msgs/ProcessFile.h @@ -0,0 +1,122 @@ +#ifndef _ROS_SERVICE_ProcessFile_h +#define _ROS_SERVICE_ProcessFile_h +#include +#include +#include +#include "ros/msg.h" + +namespace grid_map_msgs +{ + +static const char PROCESSFILE[] = "grid_map_msgs/ProcessFile"; + + class ProcessFileRequest : public ros::Msg + { + public: + typedef const char* _file_path_type; + _file_path_type file_path; + typedef const char* _topic_name_type; + _topic_name_type topic_name; + + ProcessFileRequest(): + file_path(""), + topic_name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_file_path = strlen(this->file_path); + varToArr(outbuffer + offset, length_file_path); + offset += 4; + memcpy(outbuffer + offset, this->file_path, length_file_path); + offset += length_file_path; + uint32_t length_topic_name = strlen(this->topic_name); + varToArr(outbuffer + offset, length_topic_name); + offset += 4; + memcpy(outbuffer + offset, this->topic_name, length_topic_name); + offset += length_topic_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_file_path; + arrToVar(length_file_path, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_file_path; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_file_path-1]=0; + this->file_path = (char *)(inbuffer + offset-1); + offset += length_file_path; + uint32_t length_topic_name; + arrToVar(length_topic_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_topic_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_topic_name-1]=0; + this->topic_name = (char *)(inbuffer + offset-1); + offset += length_topic_name; + return offset; + } + + virtual const char * getType() override { return PROCESSFILE; }; + virtual const char * getMD5() override { return "d33bd97bc9ab242541cf320304eff29e"; }; + + }; + + class ProcessFileResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + + ProcessFileResponse(): + success(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + return offset; + } + + virtual const char * getType() override { return PROCESSFILE; }; + virtual const char * getMD5() override { return "358e233cde0c8a8bcfea4ce193f8fc15"; }; + + }; + + class ProcessFile { + public: + typedef ProcessFileRequest Request; + typedef ProcessFileResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/grid_map_msgs/SetGridMap.h b/pio_workspace/lib/ros_lib/grid_map_msgs/SetGridMap.h new file mode 100644 index 0000000..8ae5009 --- /dev/null +++ b/pio_workspace/lib/ros_lib/grid_map_msgs/SetGridMap.h @@ -0,0 +1,76 @@ +#ifndef _ROS_SERVICE_SetGridMap_h +#define _ROS_SERVICE_SetGridMap_h +#include +#include +#include +#include "ros/msg.h" +#include "grid_map_msgs/GridMap.h" + +namespace grid_map_msgs +{ + +static const char SETGRIDMAP[] = "grid_map_msgs/SetGridMap"; + + class SetGridMapRequest : public ros::Msg + { + public: + typedef grid_map_msgs::GridMap _map_type; + _map_type map; + + SetGridMapRequest(): + map() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->map.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->map.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return SETGRIDMAP; }; + virtual const char * getMD5() override { return "4f8e24cfd42bc1470fe765b7516ff7e5"; }; + + }; + + class SetGridMapResponse : public ros::Msg + { + public: + + SetGridMapResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + return offset; + } + + virtual const char * getType() override { return SETGRIDMAP; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class SetGridMap { + public: + typedef SetGridMapRequest Request; + typedef SetGridMapResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/hector_mapping/HectorDebugInfo.h b/pio_workspace/lib/ros_lib/hector_mapping/HectorDebugInfo.h new file mode 100644 index 0000000..0ddb415 --- /dev/null +++ b/pio_workspace/lib/ros_lib/hector_mapping/HectorDebugInfo.h @@ -0,0 +1,64 @@ +#ifndef _ROS_hector_mapping_HectorDebugInfo_h +#define _ROS_hector_mapping_HectorDebugInfo_h + +#include +#include +#include +#include "ros/msg.h" +#include "hector_mapping/HectorIterData.h" + +namespace hector_mapping +{ + + class HectorDebugInfo : public ros::Msg + { + public: + uint32_t iterData_length; + typedef hector_mapping::HectorIterData _iterData_type; + _iterData_type st_iterData; + _iterData_type * iterData; + + HectorDebugInfo(): + iterData_length(0), st_iterData(), iterData(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->iterData_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->iterData_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->iterData_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->iterData_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->iterData_length); + for( uint32_t i = 0; i < iterData_length; i++){ + offset += this->iterData[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t iterData_lengthT = ((uint32_t) (*(inbuffer + offset))); + iterData_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + iterData_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + iterData_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->iterData_length); + if(iterData_lengthT > iterData_length) + this->iterData = (hector_mapping::HectorIterData*)realloc(this->iterData, iterData_lengthT * sizeof(hector_mapping::HectorIterData)); + iterData_length = iterData_lengthT; + for( uint32_t i = 0; i < iterData_length; i++){ + offset += this->st_iterData.deserialize(inbuffer + offset); + memcpy( &(this->iterData[i]), &(this->st_iterData), sizeof(hector_mapping::HectorIterData)); + } + return offset; + } + + virtual const char * getType() override { return "hector_mapping/HectorDebugInfo"; }; + virtual const char * getMD5() override { return "4d33c0696c0c536f5c1447c260756674"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/hector_mapping/HectorIterData.h b/pio_workspace/lib/ros_lib/hector_mapping/HectorIterData.h new file mode 100644 index 0000000..a8513b4 --- /dev/null +++ b/pio_workspace/lib/ros_lib/hector_mapping/HectorIterData.h @@ -0,0 +1,66 @@ +#ifndef _ROS_hector_mapping_HectorIterData_h +#define _ROS_hector_mapping_HectorIterData_h + +#include +#include +#include +#include "ros/msg.h" + +namespace hector_mapping +{ + + class HectorIterData : public ros::Msg + { + public: + float hessian[9]; + typedef float _conditionNum_type; + _conditionNum_type conditionNum; + typedef float _determinant_type; + _determinant_type determinant; + typedef float _conditionNum2d_type; + _conditionNum2d_type conditionNum2d; + typedef float _determinant2d_type; + _determinant2d_type determinant2d; + + HectorIterData(): + hessian(), + conditionNum(0), + determinant(0), + conditionNum2d(0), + determinant2d(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + for( uint32_t i = 0; i < 9; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->hessian[i]); + } + offset += serializeAvrFloat64(outbuffer + offset, this->conditionNum); + offset += serializeAvrFloat64(outbuffer + offset, this->determinant); + offset += serializeAvrFloat64(outbuffer + offset, this->conditionNum2d); + offset += serializeAvrFloat64(outbuffer + offset, this->determinant2d); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + for( uint32_t i = 0; i < 9; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->hessian[i])); + } + offset += deserializeAvrFloat64(inbuffer + offset, &(this->conditionNum)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->determinant)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->conditionNum2d)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->determinant2d)); + return offset; + } + + virtual const char * getType() override { return "hector_mapping/HectorIterData"; }; + virtual const char * getMD5() override { return "ecedaa7e26b5fc817a1add44c17fec5f"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/hector_mapping/ResetMapping.h b/pio_workspace/lib/ros_lib/hector_mapping/ResetMapping.h new file mode 100644 index 0000000..3d4482b --- /dev/null +++ b/pio_workspace/lib/ros_lib/hector_mapping/ResetMapping.h @@ -0,0 +1,76 @@ +#ifndef _ROS_SERVICE_ResetMapping_h +#define _ROS_SERVICE_ResetMapping_h +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Pose.h" + +namespace hector_mapping +{ + +static const char RESETMAPPING[] = "hector_mapping/ResetMapping"; + + class ResetMappingRequest : public ros::Msg + { + public: + typedef geometry_msgs::Pose _initial_pose_type; + _initial_pose_type initial_pose; + + ResetMappingRequest(): + initial_pose() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->initial_pose.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->initial_pose.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return RESETMAPPING; }; + virtual const char * getMD5() override { return "3423647d14c6c84592eef8b1184a5974"; }; + + }; + + class ResetMappingResponse : public ros::Msg + { + public: + + ResetMappingResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + return offset; + } + + virtual const char * getType() override { return RESETMAPPING; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class ResetMapping { + public: + typedef ResetMappingRequest Request; + typedef ResetMappingResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/laser_assembler/AssembleScans.h b/pio_workspace/lib/ros_lib/laser_assembler/AssembleScans.h deleted file mode 100644 index 2d299d5..0000000 --- a/pio_workspace/lib/ros_lib/laser_assembler/AssembleScans.h +++ /dev/null @@ -1,123 +0,0 @@ -#ifndef _ROS_SERVICE_AssembleScans_h -#define _ROS_SERVICE_AssembleScans_h -#include -#include -#include -#include "ros/msg.h" -#include "ros/time.h" -#include "sensor_msgs/PointCloud.h" - -namespace laser_assembler -{ - -static const char ASSEMBLESCANS[] = "laser_assembler/AssembleScans"; - - class AssembleScansRequest : public ros::Msg - { - public: - typedef ros::Time _begin_type; - _begin_type begin; - typedef ros::Time _end_type; - _end_type end; - - AssembleScansRequest(): - begin(), - end() - { - } - - virtual int serialize(unsigned char *outbuffer) const override - { - int offset = 0; - *(outbuffer + offset + 0) = (this->begin.sec >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (this->begin.sec >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (this->begin.sec >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (this->begin.sec >> (8 * 3)) & 0xFF; - offset += sizeof(this->begin.sec); - *(outbuffer + offset + 0) = (this->begin.nsec >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (this->begin.nsec >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (this->begin.nsec >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (this->begin.nsec >> (8 * 3)) & 0xFF; - offset += sizeof(this->begin.nsec); - *(outbuffer + offset + 0) = (this->end.sec >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (this->end.sec >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (this->end.sec >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (this->end.sec >> (8 * 3)) & 0xFF; - offset += sizeof(this->end.sec); - *(outbuffer + offset + 0) = (this->end.nsec >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (this->end.nsec >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (this->end.nsec >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (this->end.nsec >> (8 * 3)) & 0xFF; - offset += sizeof(this->end.nsec); - return offset; - } - - virtual int deserialize(unsigned char *inbuffer) override - { - int offset = 0; - this->begin.sec = ((uint32_t) (*(inbuffer + offset))); - this->begin.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - this->begin.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - this->begin.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - offset += sizeof(this->begin.sec); - this->begin.nsec = ((uint32_t) (*(inbuffer + offset))); - this->begin.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - this->begin.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - this->begin.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - offset += sizeof(this->begin.nsec); - this->end.sec = ((uint32_t) (*(inbuffer + offset))); - this->end.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - this->end.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - this->end.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - offset += sizeof(this->end.sec); - this->end.nsec = ((uint32_t) (*(inbuffer + offset))); - this->end.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - this->end.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - this->end.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - offset += sizeof(this->end.nsec); - return offset; - } - - virtual const char * getType() override { return ASSEMBLESCANS; }; - virtual const char * getMD5() override { return "b341004f74e15bf5e1b2053a9183bdc7"; }; - - }; - - class AssembleScansResponse : public ros::Msg - { - public: - typedef sensor_msgs::PointCloud _cloud_type; - _cloud_type cloud; - - AssembleScansResponse(): - cloud() - { - } - - virtual int serialize(unsigned char *outbuffer) const override - { - int offset = 0; - offset += this->cloud.serialize(outbuffer + offset); - return offset; - } - - virtual int deserialize(unsigned char *inbuffer) override - { - int offset = 0; - offset += this->cloud.deserialize(inbuffer + offset); - return offset; - } - - virtual const char * getType() override { return ASSEMBLESCANS; }; - virtual const char * getMD5() override { return "4217b28a903e4ad7869a83b3653110ff"; }; - - }; - - class AssembleScans { - public: - typedef AssembleScansRequest Request; - typedef AssembleScansResponse Response; - }; - -} -#endif diff --git a/pio_workspace/lib/ros_lib/laser_assembler/AssembleScans2.h b/pio_workspace/lib/ros_lib/laser_assembler/AssembleScans2.h deleted file mode 100644 index f7ed1ad..0000000 --- a/pio_workspace/lib/ros_lib/laser_assembler/AssembleScans2.h +++ /dev/null @@ -1,123 +0,0 @@ -#ifndef _ROS_SERVICE_AssembleScans2_h -#define _ROS_SERVICE_AssembleScans2_h -#include -#include -#include -#include "ros/msg.h" -#include "sensor_msgs/PointCloud2.h" -#include "ros/time.h" - -namespace laser_assembler -{ - -static const char ASSEMBLESCANS2[] = "laser_assembler/AssembleScans2"; - - class AssembleScans2Request : public ros::Msg - { - public: - typedef ros::Time _begin_type; - _begin_type begin; - typedef ros::Time _end_type; - _end_type end; - - AssembleScans2Request(): - begin(), - end() - { - } - - virtual int serialize(unsigned char *outbuffer) const override - { - int offset = 0; - *(outbuffer + offset + 0) = (this->begin.sec >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (this->begin.sec >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (this->begin.sec >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (this->begin.sec >> (8 * 3)) & 0xFF; - offset += sizeof(this->begin.sec); - *(outbuffer + offset + 0) = (this->begin.nsec >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (this->begin.nsec >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (this->begin.nsec >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (this->begin.nsec >> (8 * 3)) & 0xFF; - offset += sizeof(this->begin.nsec); - *(outbuffer + offset + 0) = (this->end.sec >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (this->end.sec >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (this->end.sec >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (this->end.sec >> (8 * 3)) & 0xFF; - offset += sizeof(this->end.sec); - *(outbuffer + offset + 0) = (this->end.nsec >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (this->end.nsec >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (this->end.nsec >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (this->end.nsec >> (8 * 3)) & 0xFF; - offset += sizeof(this->end.nsec); - return offset; - } - - virtual int deserialize(unsigned char *inbuffer) override - { - int offset = 0; - this->begin.sec = ((uint32_t) (*(inbuffer + offset))); - this->begin.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - this->begin.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - this->begin.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - offset += sizeof(this->begin.sec); - this->begin.nsec = ((uint32_t) (*(inbuffer + offset))); - this->begin.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - this->begin.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - this->begin.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - offset += sizeof(this->begin.nsec); - this->end.sec = ((uint32_t) (*(inbuffer + offset))); - this->end.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - this->end.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - this->end.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - offset += sizeof(this->end.sec); - this->end.nsec = ((uint32_t) (*(inbuffer + offset))); - this->end.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - this->end.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - this->end.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - offset += sizeof(this->end.nsec); - return offset; - } - - virtual const char * getType() override { return ASSEMBLESCANS2; }; - virtual const char * getMD5() override { return "b341004f74e15bf5e1b2053a9183bdc7"; }; - - }; - - class AssembleScans2Response : public ros::Msg - { - public: - typedef sensor_msgs::PointCloud2 _cloud_type; - _cloud_type cloud; - - AssembleScans2Response(): - cloud() - { - } - - virtual int serialize(unsigned char *outbuffer) const override - { - int offset = 0; - offset += this->cloud.serialize(outbuffer + offset); - return offset; - } - - virtual int deserialize(unsigned char *inbuffer) override - { - int offset = 0; - offset += this->cloud.deserialize(inbuffer + offset); - return offset; - } - - virtual const char * getType() override { return ASSEMBLESCANS2; }; - virtual const char * getMD5() override { return "96cec5374164b3b3d1d7ef5d7628a7ed"; }; - - }; - - class AssembleScans2 { - public: - typedef AssembleScans2Request Request; - typedef AssembleScans2Response Response; - }; - -} -#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/ADSBVehicle.h b/pio_workspace/lib/ros_lib/mavros_msgs/ADSBVehicle.h new file mode 100644 index 0000000..54c8190 --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/ADSBVehicle.h @@ -0,0 +1,268 @@ +#ifndef _ROS_mavros_msgs_ADSBVehicle_h +#define _ROS_mavros_msgs_ADSBVehicle_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "ros/duration.h" + +namespace mavros_msgs +{ + + class ADSBVehicle : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef uint32_t _ICAO_address_type; + _ICAO_address_type ICAO_address; + typedef const char* _callsign_type; + _callsign_type callsign; + typedef float _latitude_type; + _latitude_type latitude; + typedef float _longitude_type; + _longitude_type longitude; + typedef float _altitude_type; + _altitude_type altitude; + typedef float _heading_type; + _heading_type heading; + typedef float _hor_velocity_type; + _hor_velocity_type hor_velocity; + typedef float _ver_velocity_type; + _ver_velocity_type ver_velocity; + typedef uint8_t _altitude_type_type; + _altitude_type_type altitude_type; + typedef uint8_t _emitter_type_type; + _emitter_type_type emitter_type; + typedef ros::Duration _tslc_type; + _tslc_type tslc; + typedef uint16_t _flags_type; + _flags_type flags; + typedef uint16_t _squawk_type; + _squawk_type squawk; + enum { ALT_PRESSURE_QNH = 0 }; + enum { ALT_GEOMETRIC = 1 }; + enum { EMITTER_NO_INFO = 0 }; + enum { EMITTER_LIGHT = 1 }; + enum { EMITTER_SMALL = 2 }; + enum { EMITTER_LARGE = 3 }; + enum { EMITTER_HIGH_VORTEX_LARGE = 4 }; + enum { EMITTER_HEAVY = 5 }; + enum { EMITTER_HIGHLY_MANUV = 6 }; + enum { EMITTER_ROTOCRAFT = 7 }; + enum { EMITTER_UNASSIGNED = 8 }; + enum { EMITTER_GLIDER = 9 }; + enum { EMITTER_LIGHTER_AIR = 10 }; + enum { EMITTER_PARACHUTE = 11 }; + enum { EMITTER_ULTRA_LIGHT = 12 }; + enum { EMITTER_UNASSIGNED2 = 13 }; + enum { EMITTER_UAV = 14 }; + enum { EMITTER_SPACE = 15 }; + enum { EMITTER_UNASSGINED3 = 16 }; + enum { EMITTER_EMERGENCY_SURFACE = 17 }; + enum { EMITTER_SERVICE_SURFACE = 18 }; + enum { EMITTER_POINT_OBSTACLE = 19 }; + enum { FLAG_VALID_COORDS = 1 }; + enum { FLAG_VALID_ALTITUDE = 2 }; + enum { FLAG_VALID_HEADING = 4 }; + enum { FLAG_VALID_VELOCITY = 8 }; + enum { FLAG_VALID_CALLSIGN = 16 }; + enum { FLAG_VALID_SQUAWK = 32 }; + enum { FLAG_SIMULATED = 64 }; + enum { FLAG_VERTICAL_VELOCITY_VALID = 128 }; + enum { FLAG_BARO_VALID = 256 }; + enum { FLAG_SOURCE_UAT = 32768 }; + + ADSBVehicle(): + header(), + ICAO_address(0), + callsign(""), + latitude(0), + longitude(0), + altitude(0), + heading(0), + hor_velocity(0), + ver_velocity(0), + altitude_type(0), + emitter_type(0), + tslc(), + flags(0), + squawk(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->ICAO_address >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->ICAO_address >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->ICAO_address >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->ICAO_address >> (8 * 3)) & 0xFF; + offset += sizeof(this->ICAO_address); + uint32_t length_callsign = strlen(this->callsign); + varToArr(outbuffer + offset, length_callsign); + offset += 4; + memcpy(outbuffer + offset, this->callsign, length_callsign); + offset += length_callsign; + offset += serializeAvrFloat64(outbuffer + offset, this->latitude); + offset += serializeAvrFloat64(outbuffer + offset, this->longitude); + union { + float real; + uint32_t base; + } u_altitude; + u_altitude.real = this->altitude; + *(outbuffer + offset + 0) = (u_altitude.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_altitude.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_altitude.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_altitude.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->altitude); + union { + float real; + uint32_t base; + } u_heading; + u_heading.real = this->heading; + *(outbuffer + offset + 0) = (u_heading.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_heading.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_heading.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_heading.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->heading); + union { + float real; + uint32_t base; + } u_hor_velocity; + u_hor_velocity.real = this->hor_velocity; + *(outbuffer + offset + 0) = (u_hor_velocity.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_hor_velocity.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_hor_velocity.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_hor_velocity.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->hor_velocity); + union { + float real; + uint32_t base; + } u_ver_velocity; + u_ver_velocity.real = this->ver_velocity; + *(outbuffer + offset + 0) = (u_ver_velocity.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_ver_velocity.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_ver_velocity.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_ver_velocity.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->ver_velocity); + *(outbuffer + offset + 0) = (this->altitude_type >> (8 * 0)) & 0xFF; + offset += sizeof(this->altitude_type); + *(outbuffer + offset + 0) = (this->emitter_type >> (8 * 0)) & 0xFF; + offset += sizeof(this->emitter_type); + *(outbuffer + offset + 0) = (this->tslc.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->tslc.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->tslc.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->tslc.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->tslc.sec); + *(outbuffer + offset + 0) = (this->tslc.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->tslc.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->tslc.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->tslc.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->tslc.nsec); + *(outbuffer + offset + 0) = (this->flags >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->flags >> (8 * 1)) & 0xFF; + offset += sizeof(this->flags); + *(outbuffer + offset + 0) = (this->squawk >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->squawk >> (8 * 1)) & 0xFF; + offset += sizeof(this->squawk); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + this->ICAO_address = ((uint32_t) (*(inbuffer + offset))); + this->ICAO_address |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->ICAO_address |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->ICAO_address |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->ICAO_address); + uint32_t length_callsign; + arrToVar(length_callsign, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_callsign; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_callsign-1]=0; + this->callsign = (char *)(inbuffer + offset-1); + offset += length_callsign; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->latitude)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->longitude)); + union { + float real; + uint32_t base; + } u_altitude; + u_altitude.base = 0; + u_altitude.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_altitude.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_altitude.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_altitude.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->altitude = u_altitude.real; + offset += sizeof(this->altitude); + union { + float real; + uint32_t base; + } u_heading; + u_heading.base = 0; + u_heading.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_heading.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_heading.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_heading.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->heading = u_heading.real; + offset += sizeof(this->heading); + union { + float real; + uint32_t base; + } u_hor_velocity; + u_hor_velocity.base = 0; + u_hor_velocity.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_hor_velocity.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_hor_velocity.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_hor_velocity.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->hor_velocity = u_hor_velocity.real; + offset += sizeof(this->hor_velocity); + union { + float real; + uint32_t base; + } u_ver_velocity; + u_ver_velocity.base = 0; + u_ver_velocity.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_ver_velocity.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_ver_velocity.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_ver_velocity.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->ver_velocity = u_ver_velocity.real; + offset += sizeof(this->ver_velocity); + this->altitude_type = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->altitude_type); + this->emitter_type = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->emitter_type); + this->tslc.sec = ((uint32_t) (*(inbuffer + offset))); + this->tslc.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->tslc.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->tslc.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->tslc.sec); + this->tslc.nsec = ((uint32_t) (*(inbuffer + offset))); + this->tslc.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->tslc.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->tslc.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->tslc.nsec); + this->flags = ((uint16_t) (*(inbuffer + offset))); + this->flags |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->flags); + this->squawk = ((uint16_t) (*(inbuffer + offset))); + this->squawk |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->squawk); + return offset; + } + + virtual const char * getType() override { return "mavros_msgs/ADSBVehicle"; }; + virtual const char * getMD5() override { return "d532685113a66fcc6ba0e6363ace0244"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/ActuatorControl.h b/pio_workspace/lib/ros_lib/mavros_msgs/ActuatorControl.h new file mode 100644 index 0000000..6bea678 --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/ActuatorControl.h @@ -0,0 +1,82 @@ +#ifndef _ROS_mavros_msgs_ActuatorControl_h +#define _ROS_mavros_msgs_ActuatorControl_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace mavros_msgs +{ + + class ActuatorControl : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef uint8_t _group_mix_type; + _group_mix_type group_mix; + float controls[8]; + enum { PX4_MIX_FLIGHT_CONTROL = 0 }; + enum { PX4_MIX_FLIGHT_CONTROL_VTOL_ALT = 1 }; + enum { PX4_MIX_PAYLOAD = 2 }; + enum { PX4_MIX_MANUAL_PASSTHROUGH = 3 }; + + ActuatorControl(): + header(), + group_mix(0), + controls() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->group_mix >> (8 * 0)) & 0xFF; + offset += sizeof(this->group_mix); + for( uint32_t i = 0; i < 8; i++){ + union { + float real; + uint32_t base; + } u_controlsi; + u_controlsi.real = this->controls[i]; + *(outbuffer + offset + 0) = (u_controlsi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_controlsi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_controlsi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_controlsi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->controls[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + this->group_mix = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->group_mix); + for( uint32_t i = 0; i < 8; i++){ + union { + float real; + uint32_t base; + } u_controlsi; + u_controlsi.base = 0; + u_controlsi.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_controlsi.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_controlsi.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_controlsi.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->controls[i] = u_controlsi.real; + offset += sizeof(this->controls[i]); + } + return offset; + } + + virtual const char * getType() override { return "mavros_msgs/ActuatorControl"; }; + virtual const char * getMD5() override { return "9eea0a80c88944fe2fb67f3b3768854b"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/Altitude.h b/pio_workspace/lib/ros_lib/mavros_msgs/Altitude.h new file mode 100644 index 0000000..6fb005f --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/Altitude.h @@ -0,0 +1,188 @@ +#ifndef _ROS_mavros_msgs_Altitude_h +#define _ROS_mavros_msgs_Altitude_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace mavros_msgs +{ + + class Altitude : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef float _monotonic_type; + _monotonic_type monotonic; + typedef float _amsl_type; + _amsl_type amsl; + typedef float _local_type; + _local_type local; + typedef float _relative_type; + _relative_type relative; + typedef float _terrain_type; + _terrain_type terrain; + typedef float _bottom_clearance_type; + _bottom_clearance_type bottom_clearance; + + Altitude(): + header(), + monotonic(0), + amsl(0), + local(0), + relative(0), + terrain(0), + bottom_clearance(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + union { + float real; + uint32_t base; + } u_monotonic; + u_monotonic.real = this->monotonic; + *(outbuffer + offset + 0) = (u_monotonic.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_monotonic.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_monotonic.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_monotonic.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->monotonic); + union { + float real; + uint32_t base; + } u_amsl; + u_amsl.real = this->amsl; + *(outbuffer + offset + 0) = (u_amsl.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_amsl.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_amsl.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_amsl.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->amsl); + union { + float real; + uint32_t base; + } u_local; + u_local.real = this->local; + *(outbuffer + offset + 0) = (u_local.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_local.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_local.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_local.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->local); + union { + float real; + uint32_t base; + } u_relative; + u_relative.real = this->relative; + *(outbuffer + offset + 0) = (u_relative.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_relative.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_relative.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_relative.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->relative); + union { + float real; + uint32_t base; + } u_terrain; + u_terrain.real = this->terrain; + *(outbuffer + offset + 0) = (u_terrain.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_terrain.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_terrain.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_terrain.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->terrain); + union { + float real; + uint32_t base; + } u_bottom_clearance; + u_bottom_clearance.real = this->bottom_clearance; + *(outbuffer + offset + 0) = (u_bottom_clearance.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_bottom_clearance.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_bottom_clearance.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_bottom_clearance.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->bottom_clearance); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + union { + float real; + uint32_t base; + } u_monotonic; + u_monotonic.base = 0; + u_monotonic.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_monotonic.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_monotonic.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_monotonic.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->monotonic = u_monotonic.real; + offset += sizeof(this->monotonic); + union { + float real; + uint32_t base; + } u_amsl; + u_amsl.base = 0; + u_amsl.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_amsl.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_amsl.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_amsl.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->amsl = u_amsl.real; + offset += sizeof(this->amsl); + union { + float real; + uint32_t base; + } u_local; + u_local.base = 0; + u_local.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_local.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_local.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_local.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->local = u_local.real; + offset += sizeof(this->local); + union { + float real; + uint32_t base; + } u_relative; + u_relative.base = 0; + u_relative.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_relative.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_relative.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_relative.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->relative = u_relative.real; + offset += sizeof(this->relative); + union { + float real; + uint32_t base; + } u_terrain; + u_terrain.base = 0; + u_terrain.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_terrain.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_terrain.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_terrain.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->terrain = u_terrain.real; + offset += sizeof(this->terrain); + union { + float real; + uint32_t base; + } u_bottom_clearance; + u_bottom_clearance.base = 0; + u_bottom_clearance.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_bottom_clearance.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_bottom_clearance.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_bottom_clearance.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->bottom_clearance = u_bottom_clearance.real; + offset += sizeof(this->bottom_clearance); + return offset; + } + + virtual const char * getType() override { return "mavros_msgs/Altitude"; }; + virtual const char * getMD5() override { return "1296a05dc5b6160be0ae04ba9ed3a3fa"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/AttitudeTarget.h b/pio_workspace/lib/ros_lib/mavros_msgs/AttitudeTarget.h new file mode 100644 index 0000000..3c86b12 --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/AttitudeTarget.h @@ -0,0 +1,92 @@ +#ifndef _ROS_mavros_msgs_AttitudeTarget_h +#define _ROS_mavros_msgs_AttitudeTarget_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Quaternion.h" +#include "geometry_msgs/Vector3.h" + +namespace mavros_msgs +{ + + class AttitudeTarget : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef uint8_t _type_mask_type; + _type_mask_type type_mask; + typedef geometry_msgs::Quaternion _orientation_type; + _orientation_type orientation; + typedef geometry_msgs::Vector3 _body_rate_type; + _body_rate_type body_rate; + typedef float _thrust_type; + _thrust_type thrust; + enum { IGNORE_ROLL_RATE = 1 }; + enum { IGNORE_PITCH_RATE = 2 }; + enum { IGNORE_YAW_RATE = 4 }; + enum { IGNORE_THRUST = 64 }; + enum { IGNORE_ATTITUDE = 128 }; + + AttitudeTarget(): + header(), + type_mask(0), + orientation(), + body_rate(), + thrust(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->type_mask >> (8 * 0)) & 0xFF; + offset += sizeof(this->type_mask); + offset += this->orientation.serialize(outbuffer + offset); + offset += this->body_rate.serialize(outbuffer + offset); + union { + float real; + uint32_t base; + } u_thrust; + u_thrust.real = this->thrust; + *(outbuffer + offset + 0) = (u_thrust.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_thrust.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_thrust.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_thrust.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->thrust); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + this->type_mask = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->type_mask); + offset += this->orientation.deserialize(inbuffer + offset); + offset += this->body_rate.deserialize(inbuffer + offset); + union { + float real; + uint32_t base; + } u_thrust; + u_thrust.base = 0; + u_thrust.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_thrust.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_thrust.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_thrust.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->thrust = u_thrust.real; + offset += sizeof(this->thrust); + return offset; + } + + virtual const char * getType() override { return "mavros_msgs/AttitudeTarget"; }; + virtual const char * getMD5() override { return "456f3af666b22ccd0222ea053a86b548"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/BatteryStatus.h b/pio_workspace/lib/ros_lib/mavros_msgs/BatteryStatus.h new file mode 100644 index 0000000..8f5139a --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/BatteryStatus.h @@ -0,0 +1,116 @@ +#ifndef _ROS_mavros_msgs_BatteryStatus_h +#define _ROS_mavros_msgs_BatteryStatus_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace mavros_msgs +{ + + class BatteryStatus : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef float _voltage_type; + _voltage_type voltage; + typedef float _current_type; + _current_type current; + typedef float _remaining_type; + _remaining_type remaining; + + BatteryStatus(): + header(), + voltage(0), + current(0), + remaining(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + union { + float real; + uint32_t base; + } u_voltage; + u_voltage.real = this->voltage; + *(outbuffer + offset + 0) = (u_voltage.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_voltage.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_voltage.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_voltage.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->voltage); + union { + float real; + uint32_t base; + } u_current; + u_current.real = this->current; + *(outbuffer + offset + 0) = (u_current.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_current.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_current.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_current.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->current); + union { + float real; + uint32_t base; + } u_remaining; + u_remaining.real = this->remaining; + *(outbuffer + offset + 0) = (u_remaining.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_remaining.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_remaining.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_remaining.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->remaining); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + union { + float real; + uint32_t base; + } u_voltage; + u_voltage.base = 0; + u_voltage.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_voltage.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_voltage.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_voltage.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->voltage = u_voltage.real; + offset += sizeof(this->voltage); + union { + float real; + uint32_t base; + } u_current; + u_current.base = 0; + u_current.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_current.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_current.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_current.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->current = u_current.real; + offset += sizeof(this->current); + union { + float real; + uint32_t base; + } u_remaining; + u_remaining.base = 0; + u_remaining.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_remaining.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_remaining.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_remaining.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->remaining = u_remaining.real; + offset += sizeof(this->remaining); + return offset; + } + + virtual const char * getType() override { return "mavros_msgs/BatteryStatus"; }; + virtual const char * getMD5() override { return "8ba4ae7c602c5ae6a7e8f3ffb652dc5f"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/CamIMUStamp.h b/pio_workspace/lib/ros_lib/mavros_msgs/CamIMUStamp.h new file mode 100644 index 0000000..9c73f78 --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/CamIMUStamp.h @@ -0,0 +1,86 @@ +#ifndef _ROS_mavros_msgs_CamIMUStamp_h +#define _ROS_mavros_msgs_CamIMUStamp_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/time.h" + +namespace mavros_msgs +{ + + class CamIMUStamp : public ros::Msg + { + public: + typedef ros::Time _frame_stamp_type; + _frame_stamp_type frame_stamp; + typedef int32_t _frame_seq_id_type; + _frame_seq_id_type frame_seq_id; + + CamIMUStamp(): + frame_stamp(), + frame_seq_id(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->frame_stamp.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->frame_stamp.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->frame_stamp.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->frame_stamp.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->frame_stamp.sec); + *(outbuffer + offset + 0) = (this->frame_stamp.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->frame_stamp.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->frame_stamp.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->frame_stamp.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->frame_stamp.nsec); + union { + int32_t real; + uint32_t base; + } u_frame_seq_id; + u_frame_seq_id.real = this->frame_seq_id; + *(outbuffer + offset + 0) = (u_frame_seq_id.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_frame_seq_id.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_frame_seq_id.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_frame_seq_id.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->frame_seq_id); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->frame_stamp.sec = ((uint32_t) (*(inbuffer + offset))); + this->frame_stamp.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->frame_stamp.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->frame_stamp.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->frame_stamp.sec); + this->frame_stamp.nsec = ((uint32_t) (*(inbuffer + offset))); + this->frame_stamp.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->frame_stamp.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->frame_stamp.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->frame_stamp.nsec); + union { + int32_t real; + uint32_t base; + } u_frame_seq_id; + u_frame_seq_id.base = 0; + u_frame_seq_id.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_frame_seq_id.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_frame_seq_id.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_frame_seq_id.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->frame_seq_id = u_frame_seq_id.real; + offset += sizeof(this->frame_seq_id); + return offset; + } + + virtual const char * getType() override { return "mavros_msgs/CamIMUStamp"; }; + virtual const char * getMD5() override { return "ac22af9031671dd528a56f12d0986660"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/CameraImageCaptured.h b/pio_workspace/lib/ros_lib/mavros_msgs/CameraImageCaptured.h new file mode 100644 index 0000000..5185056 --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/CameraImageCaptured.h @@ -0,0 +1,139 @@ +#ifndef _ROS_mavros_msgs_CameraImageCaptured_h +#define _ROS_mavros_msgs_CameraImageCaptured_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Quaternion.h" +#include "geographic_msgs/GeoPoint.h" + +namespace mavros_msgs +{ + + class CameraImageCaptured : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef geometry_msgs::Quaternion _orientation_type; + _orientation_type orientation; + typedef geographic_msgs::GeoPoint _geo_type; + _geo_type geo; + typedef float _relative_alt_type; + _relative_alt_type relative_alt; + typedef int32_t _image_index_type; + _image_index_type image_index; + typedef int8_t _capture_result_type; + _capture_result_type capture_result; + typedef const char* _file_url_type; + _file_url_type file_url; + + CameraImageCaptured(): + header(), + orientation(), + geo(), + relative_alt(0), + image_index(0), + capture_result(0), + file_url("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->orientation.serialize(outbuffer + offset); + offset += this->geo.serialize(outbuffer + offset); + union { + float real; + uint32_t base; + } u_relative_alt; + u_relative_alt.real = this->relative_alt; + *(outbuffer + offset + 0) = (u_relative_alt.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_relative_alt.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_relative_alt.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_relative_alt.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->relative_alt); + union { + int32_t real; + uint32_t base; + } u_image_index; + u_image_index.real = this->image_index; + *(outbuffer + offset + 0) = (u_image_index.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_image_index.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_image_index.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_image_index.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->image_index); + union { + int8_t real; + uint8_t base; + } u_capture_result; + u_capture_result.real = this->capture_result; + *(outbuffer + offset + 0) = (u_capture_result.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->capture_result); + uint32_t length_file_url = strlen(this->file_url); + varToArr(outbuffer + offset, length_file_url); + offset += 4; + memcpy(outbuffer + offset, this->file_url, length_file_url); + offset += length_file_url; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->orientation.deserialize(inbuffer + offset); + offset += this->geo.deserialize(inbuffer + offset); + union { + float real; + uint32_t base; + } u_relative_alt; + u_relative_alt.base = 0; + u_relative_alt.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_relative_alt.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_relative_alt.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_relative_alt.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->relative_alt = u_relative_alt.real; + offset += sizeof(this->relative_alt); + union { + int32_t real; + uint32_t base; + } u_image_index; + u_image_index.base = 0; + u_image_index.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_image_index.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_image_index.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_image_index.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->image_index = u_image_index.real; + offset += sizeof(this->image_index); + union { + int8_t real; + uint8_t base; + } u_capture_result; + u_capture_result.base = 0; + u_capture_result.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->capture_result = u_capture_result.real; + offset += sizeof(this->capture_result); + uint32_t length_file_url; + arrToVar(length_file_url, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_file_url; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_file_url-1]=0; + this->file_url = (char *)(inbuffer + offset-1); + offset += length_file_url; + return offset; + } + + virtual const char * getType() override { return "mavros_msgs/CameraImageCaptured"; }; + virtual const char * getMD5() override { return "9559d135fc7e5e91d3f1b819ebcd7556"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/CellularStatus.h b/pio_workspace/lib/ros_lib/mavros_msgs/CellularStatus.h new file mode 100644 index 0000000..679e8f2 --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/CellularStatus.h @@ -0,0 +1,93 @@ +#ifndef _ROS_mavros_msgs_CellularStatus_h +#define _ROS_mavros_msgs_CellularStatus_h + +#include +#include +#include +#include "ros/msg.h" + +namespace mavros_msgs +{ + + class CellularStatus : public ros::Msg + { + public: + typedef uint8_t _status_type; + _status_type status; + typedef uint8_t _failure_reason_type; + _failure_reason_type failure_reason; + typedef uint8_t _type_type; + _type_type type; + typedef uint8_t _quality_type; + _quality_type quality; + typedef uint16_t _mcc_type; + _mcc_type mcc; + typedef uint16_t _mnc_type; + _mnc_type mnc; + typedef uint16_t _lac_type; + _lac_type lac; + + CellularStatus(): + status(0), + failure_reason(0), + type(0), + quality(0), + mcc(0), + mnc(0), + lac(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->status >> (8 * 0)) & 0xFF; + offset += sizeof(this->status); + *(outbuffer + offset + 0) = (this->failure_reason >> (8 * 0)) & 0xFF; + offset += sizeof(this->failure_reason); + *(outbuffer + offset + 0) = (this->type >> (8 * 0)) & 0xFF; + offset += sizeof(this->type); + *(outbuffer + offset + 0) = (this->quality >> (8 * 0)) & 0xFF; + offset += sizeof(this->quality); + *(outbuffer + offset + 0) = (this->mcc >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->mcc >> (8 * 1)) & 0xFF; + offset += sizeof(this->mcc); + *(outbuffer + offset + 0) = (this->mnc >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->mnc >> (8 * 1)) & 0xFF; + offset += sizeof(this->mnc); + *(outbuffer + offset + 0) = (this->lac >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->lac >> (8 * 1)) & 0xFF; + offset += sizeof(this->lac); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->status = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->status); + this->failure_reason = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->failure_reason); + this->type = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->type); + this->quality = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->quality); + this->mcc = ((uint16_t) (*(inbuffer + offset))); + this->mcc |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->mcc); + this->mnc = ((uint16_t) (*(inbuffer + offset))); + this->mnc |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->mnc); + this->lac = ((uint16_t) (*(inbuffer + offset))); + this->lac |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->lac); + return offset; + } + + virtual const char * getType() override { return "mavros_msgs/CellularStatus"; }; + virtual const char * getMD5() override { return "a474bdb9df111b4e16fab4c29f7a6956"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/CommandAck.h b/pio_workspace/lib/ros_lib/mavros_msgs/CommandAck.h new file mode 100644 index 0000000..ba812f0 --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/CommandAck.h @@ -0,0 +1,131 @@ +#ifndef _ROS_SERVICE_CommandAck_h +#define _ROS_SERVICE_CommandAck_h +#include +#include +#include +#include "ros/msg.h" + +namespace mavros_msgs +{ + +static const char COMMANDACK[] = "mavros_msgs/CommandAck"; + + class CommandAckRequest : public ros::Msg + { + public: + typedef uint16_t _command_type; + _command_type command; + typedef uint8_t _result_type; + _result_type result; + typedef uint8_t _progress_type; + _progress_type progress; + typedef uint32_t _result_param2_type; + _result_param2_type result_param2; + + CommandAckRequest(): + command(0), + result(0), + progress(0), + result_param2(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->command >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->command >> (8 * 1)) & 0xFF; + offset += sizeof(this->command); + *(outbuffer + offset + 0) = (this->result >> (8 * 0)) & 0xFF; + offset += sizeof(this->result); + *(outbuffer + offset + 0) = (this->progress >> (8 * 0)) & 0xFF; + offset += sizeof(this->progress); + *(outbuffer + offset + 0) = (this->result_param2 >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->result_param2 >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->result_param2 >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->result_param2 >> (8 * 3)) & 0xFF; + offset += sizeof(this->result_param2); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->command = ((uint16_t) (*(inbuffer + offset))); + this->command |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->command); + this->result = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->result); + this->progress = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->progress); + this->result_param2 = ((uint32_t) (*(inbuffer + offset))); + this->result_param2 |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->result_param2 |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->result_param2 |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->result_param2); + return offset; + } + + virtual const char * getType() override { return COMMANDACK; }; + virtual const char * getMD5() override { return "1972b10ca14298d11f768e548d4d9e68"; }; + + }; + + class CommandAckResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + typedef uint8_t _result_type; + _result_type result; + + CommandAckResponse(): + success(0), + result(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + *(outbuffer + offset + 0) = (this->result >> (8 * 0)) & 0xFF; + offset += sizeof(this->result); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + this->result = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->result); + return offset; + } + + virtual const char * getType() override { return COMMANDACK; }; + virtual const char * getMD5() override { return "1cd894375e4e3d2861d2222772894fdb"; }; + + }; + + class CommandAck { + public: + typedef CommandAckRequest Request; + typedef CommandAckResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/CommandBool.h b/pio_workspace/lib/ros_lib/mavros_msgs/CommandBool.h new file mode 100644 index 0000000..df3a2b4 --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/CommandBool.h @@ -0,0 +1,113 @@ +#ifndef _ROS_SERVICE_CommandBool_h +#define _ROS_SERVICE_CommandBool_h +#include +#include +#include +#include "ros/msg.h" + +namespace mavros_msgs +{ + +static const char COMMANDBOOL[] = "mavros_msgs/CommandBool"; + + class CommandBoolRequest : public ros::Msg + { + public: + typedef bool _value_type; + _value_type value; + + CommandBoolRequest(): + value(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_value; + u_value.real = this->value; + *(outbuffer + offset + 0) = (u_value.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->value); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_value; + u_value.base = 0; + u_value.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->value = u_value.real; + offset += sizeof(this->value); + return offset; + } + + virtual const char * getType() override { return COMMANDBOOL; }; + virtual const char * getMD5() override { return "e431d687bf4b2c65fbd94b12ae0cb5d9"; }; + + }; + + class CommandBoolResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + typedef uint8_t _result_type; + _result_type result; + + CommandBoolResponse(): + success(0), + result(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + *(outbuffer + offset + 0) = (this->result >> (8 * 0)) & 0xFF; + offset += sizeof(this->result); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + this->result = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->result); + return offset; + } + + virtual const char * getType() override { return COMMANDBOOL; }; + virtual const char * getMD5() override { return "1cd894375e4e3d2861d2222772894fdb"; }; + + }; + + class CommandBool { + public: + typedef CommandBoolRequest Request; + typedef CommandBoolResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/CommandCode.h b/pio_workspace/lib/ros_lib/mavros_msgs/CommandCode.h new file mode 100644 index 0000000..b6868db --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/CommandCode.h @@ -0,0 +1,173 @@ +#ifndef _ROS_mavros_msgs_CommandCode_h +#define _ROS_mavros_msgs_CommandCode_h + +#include +#include +#include +#include "ros/msg.h" + +namespace mavros_msgs +{ + + class CommandCode : public ros::Msg + { + public: + enum { AIRFRAME_CONFIGURATION = 2520 }; + enum { ARM_AUTHORIZATION_REQUEST = 3001 }; + enum { CAMERA_TRACK_POINT = 2004 }; + enum { CAMERA_TRACK_RECTANGLE = 2005 }; + enum { CAMERA_STOP_TRACKING = 2010 }; + enum { CAN_FORWARD = 32000 }; + enum { COMPONENT_ARM_DISARM = 400 }; + enum { CONDITION_DELAY = 112 }; + enum { CONDITION_CHANGE_ALT = 113 }; + enum { CONDITION_DISTANCE = 114 }; + enum { CONDITION_YAW = 115 }; + enum { CONDITION_LAST = 159 }; + enum { CONTROL_HIGH_LATENCY = 2600 }; + enum { DO_FOLLOW = 32 }; + enum { DO_FOLLOW_REPOSITION = 33 }; + enum { DO_SET_MODE = 176 }; + enum { DO_JUMP = 177 }; + enum { DO_CHANGE_SPEED = 178 }; + enum { DO_SET_HOME = 179 }; + enum { DO_SET_PARAMETER = 180 }; + enum { DO_SET_RELAY = 181 }; + enum { DO_REPEAT_RELAY = 182 }; + enum { DO_SET_SERVO = 183 }; + enum { DO_REPEAT_SERVO = 184 }; + enum { DO_FLIGHTTERMINATION = 185 }; + enum { DO_CHANGE_ALTITUDE = 186 }; + enum { DO_LAND_START = 189 }; + enum { DO_RALLY_LAND = 190 }; + enum { DO_GO_AROUND = 191 }; + enum { DO_REPOSITION = 192 }; + enum { DO_PAUSE_CONTINUE = 193 }; + enum { DO_SET_REVERSE = 194 }; + enum { DO_SET_ROI_LOCATION = 195 }; + enum { DO_SET_ROI_WPNEXT_OFFSET = 196 }; + enum { DO_SET_ROI_NONE = 197 }; + enum { DO_SET_ROI_SYSID = 198 }; + enum { DO_CONTROL_VIDEO = 200 }; + enum { DO_SET_ROI = 201 }; + enum { DO_DIGICAM_CONFIGURE = 202 }; + enum { DO_DIGICAM_CONTROL = 203 }; + enum { DO_MOUNT_CONFIGURE = 204 }; + enum { DO_MOUNT_CONTROL = 205 }; + enum { DO_SET_CAM_TRIGG_DIST = 206 }; + enum { DO_FENCE_ENABLE = 207 }; + enum { DO_PARACHUTE = 208 }; + enum { DO_MOTOR_TEST = 209 }; + enum { DO_INVERTED_FLIGHT = 210 }; + enum { DO_GRIPPER = 211 }; + enum { DO_AUTOTUNE_ENABLE = 212 }; + enum { DO_SET_CAM_TRIGG_INTERVAL = 214 }; + enum { DO_MOUNT_CONTROL_QUAT = 220 }; + enum { DO_GUIDED_MASTER = 221 }; + enum { DO_GUIDED_LIMITS = 222 }; + enum { DO_ENGINE_CONTROL = 223 }; + enum { DO_SET_MISSION_CURRENT = 224 }; + enum { DO_LAST = 240 }; + enum { DO_JUMP_TAG = 601 }; + enum { DO_GIMBAL_MANAGER_PITCHYAW = 1000 }; + enum { DO_GIMBAL_MANAGER_CONFIGURE = 1001 }; + enum { DO_TRIGGER_CONTROL = 2003 }; + enum { DO_VTOL_TRANSITION = 3000 }; + enum { DO_ADSB_OUT_IDENT = 10001 }; + enum { DO_WINCH = 42600 }; + enum { FIXED_MAG_CAL_YAW = 42006 }; + enum { GET_HOME_POSITION = 410 }; + enum { GET_MESSAGE_INTERVAL = 510 }; + enum { IMAGE_START_CAPTURE = 2000 }; + enum { IMAGE_STOP_CAPTURE = 2001 }; + enum { JUMP_TAG = 600 }; + enum { LOGGING_START = 2510 }; + enum { LOGGING_STOP = 2511 }; + enum { MISSION_START = 300 }; + enum { NAV_WAYPOINT = 16 }; + enum { NAV_LOITER_UNLIM = 17 }; + enum { NAV_LOITER_TURNS = 18 }; + enum { NAV_LOITER_TIME = 19 }; + enum { NAV_RETURN_TO_LAUNCH = 20 }; + enum { NAV_LAND = 21 }; + enum { NAV_TAKEOFF = 22 }; + enum { NAV_LAND_LOCAL = 23 }; + enum { NAV_TAKEOFF_LOCAL = 24 }; + enum { NAV_FOLLOW = 25 }; + enum { NAV_CONTINUE_AND_CHANGE_ALT = 30 }; + enum { NAV_LOITER_TO_ALT = 31 }; + enum { NAV_ROI = 80 }; + enum { NAV_PATHPLANNING = 81 }; + enum { NAV_SPLINE_WAYPOINT = 82 }; + enum { NAV_VTOL_TAKEOFF = 84 }; + enum { NAV_VTOL_LAND = 85 }; + enum { NAV_GUIDED_ENABLE = 92 }; + enum { NAV_DELAY = 93 }; + enum { NAV_PAYLOAD_PLACE = 94 }; + enum { NAV_LAST = 95 }; + enum { NAV_SET_YAW_SPEED = 213 }; + enum { NAV_FENCE_RETURN_POINT = 5000 }; + enum { NAV_FENCE_POLYGON_VERTEX_INCLUSION = 5001 }; + enum { NAV_FENCE_POLYGON_VERTEX_EXCLUSION = 5002 }; + enum { NAV_FENCE_CIRCLE_INCLUSION = 5003 }; + enum { NAV_FENCE_CIRCLE_EXCLUSION = 5004 }; + enum { NAV_RALLY_POINT = 5100 }; + enum { OBLIQUE_SURVEY = 260 }; + enum { OVERRIDE_GOTO = 252 }; + enum { PANORAMA_CREATE = 2800 }; + enum { PAYLOAD_PREPARE_DEPLOY = 30001 }; + enum { PAYLOAD_CONTROL_DEPLOY = 30002 }; + enum { PREFLIGHT_CALIBRATION = 241 }; + enum { PREFLIGHT_SET_SENSOR_OFFSETS = 242 }; + enum { PREFLIGHT_UAVCAN = 243 }; + enum { PREFLIGHT_STORAGE = 245 }; + enum { PREFLIGHT_REBOOT_SHUTDOWN = 246 }; + enum { REQUEST_MESSAGE = 512 }; + enum { REQUEST_PROTOCOL_VERSION = 519 }; + enum { REQUEST_AUTOPILOT_CAPABILITIES = 520 }; + enum { REQUEST_CAMERA_INFORMATION = 521 }; + enum { REQUEST_CAMERA_SETTINGS = 522 }; + enum { REQUEST_STORAGE_INFORMATION = 525 }; + enum { REQUEST_CAMERA_CAPTURE_STATUS = 527 }; + enum { REQUEST_FLIGHT_INFORMATION = 528 }; + enum { REQUEST_VIDEO_STREAM_INFORMATION = 2504 }; + enum { REQUEST_VIDEO_STREAM_STATUS = 2505 }; + enum { RESET_CAMERA_SETTINGS = 529 }; + enum { RUN_PREARM_CHECKS = 401 }; + enum { SET_MESSAGE_INTERVAL = 511 }; + enum { SET_CAMERA_MODE = 530 }; + enum { SET_CAMERA_ZOOM = 531 }; + enum { SET_CAMERA_FOCUS = 532 }; + enum { SET_GUIDED_SUBMODE_STANDARD = 4000 }; + enum { SET_GUIDED_SUBMODE_CIRCLE = 4001 }; + enum { START_RX_PAIR = 500 }; + enum { STORAGE_FORMAT = 526 }; + enum { UAVCAN_GET_NODE_INFO = 5200 }; + enum { VIDEO_START_CAPTURE = 2500 }; + enum { VIDEO_STOP_CAPTURE = 2501 }; + enum { VIDEO_START_STREAMING = 2502 }; + enum { VIDEO_STOP_STREAMING = 2503 }; + + CommandCode() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + return offset; + } + + virtual const char * getType() override { return "mavros_msgs/CommandCode"; }; + virtual const char * getMD5() override { return "059d72cceadaa0abca57de773508431c"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/CommandHome.h b/pio_workspace/lib/ros_lib/mavros_msgs/CommandHome.h new file mode 100644 index 0000000..fac2cc3 --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/CommandHome.h @@ -0,0 +1,209 @@ +#ifndef _ROS_SERVICE_CommandHome_h +#define _ROS_SERVICE_CommandHome_h +#include +#include +#include +#include "ros/msg.h" + +namespace mavros_msgs +{ + +static const char COMMANDHOME[] = "mavros_msgs/CommandHome"; + + class CommandHomeRequest : public ros::Msg + { + public: + typedef bool _current_gps_type; + _current_gps_type current_gps; + typedef float _yaw_type; + _yaw_type yaw; + typedef float _latitude_type; + _latitude_type latitude; + typedef float _longitude_type; + _longitude_type longitude; + typedef float _altitude_type; + _altitude_type altitude; + + CommandHomeRequest(): + current_gps(0), + yaw(0), + latitude(0), + longitude(0), + altitude(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_current_gps; + u_current_gps.real = this->current_gps; + *(outbuffer + offset + 0) = (u_current_gps.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->current_gps); + union { + float real; + uint32_t base; + } u_yaw; + u_yaw.real = this->yaw; + *(outbuffer + offset + 0) = (u_yaw.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_yaw.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_yaw.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_yaw.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->yaw); + union { + float real; + uint32_t base; + } u_latitude; + u_latitude.real = this->latitude; + *(outbuffer + offset + 0) = (u_latitude.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_latitude.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_latitude.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_latitude.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->latitude); + union { + float real; + uint32_t base; + } u_longitude; + u_longitude.real = this->longitude; + *(outbuffer + offset + 0) = (u_longitude.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_longitude.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_longitude.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_longitude.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->longitude); + union { + float real; + uint32_t base; + } u_altitude; + u_altitude.real = this->altitude; + *(outbuffer + offset + 0) = (u_altitude.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_altitude.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_altitude.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_altitude.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->altitude); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_current_gps; + u_current_gps.base = 0; + u_current_gps.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->current_gps = u_current_gps.real; + offset += sizeof(this->current_gps); + union { + float real; + uint32_t base; + } u_yaw; + u_yaw.base = 0; + u_yaw.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_yaw.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_yaw.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_yaw.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->yaw = u_yaw.real; + offset += sizeof(this->yaw); + union { + float real; + uint32_t base; + } u_latitude; + u_latitude.base = 0; + u_latitude.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_latitude.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_latitude.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_latitude.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->latitude = u_latitude.real; + offset += sizeof(this->latitude); + union { + float real; + uint32_t base; + } u_longitude; + u_longitude.base = 0; + u_longitude.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_longitude.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_longitude.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_longitude.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->longitude = u_longitude.real; + offset += sizeof(this->longitude); + union { + float real; + uint32_t base; + } u_altitude; + u_altitude.base = 0; + u_altitude.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_altitude.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_altitude.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_altitude.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->altitude = u_altitude.real; + offset += sizeof(this->altitude); + return offset; + } + + virtual const char * getType() override { return COMMANDHOME; }; + virtual const char * getMD5() override { return "af3ed5fc0724380793eba353ee384c9a"; }; + + }; + + class CommandHomeResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + typedef uint8_t _result_type; + _result_type result; + + CommandHomeResponse(): + success(0), + result(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + *(outbuffer + offset + 0) = (this->result >> (8 * 0)) & 0xFF; + offset += sizeof(this->result); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + this->result = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->result); + return offset; + } + + virtual const char * getType() override { return COMMANDHOME; }; + virtual const char * getMD5() override { return "1cd894375e4e3d2861d2222772894fdb"; }; + + }; + + class CommandHome { + public: + typedef CommandHomeRequest Request; + typedef CommandHomeResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/CommandInt.h b/pio_workspace/lib/ros_lib/mavros_msgs/CommandInt.h new file mode 100644 index 0000000..ea1b7a9 --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/CommandInt.h @@ -0,0 +1,304 @@ +#ifndef _ROS_SERVICE_CommandInt_h +#define _ROS_SERVICE_CommandInt_h +#include +#include +#include +#include "ros/msg.h" + +namespace mavros_msgs +{ + +static const char COMMANDINT[] = "mavros_msgs/CommandInt"; + + class CommandIntRequest : public ros::Msg + { + public: + typedef bool _broadcast_type; + _broadcast_type broadcast; + typedef uint8_t _frame_type; + _frame_type frame; + typedef uint16_t _command_type; + _command_type command; + typedef uint8_t _current_type; + _current_type current; + typedef uint8_t _autocontinue_type; + _autocontinue_type autocontinue; + typedef float _param1_type; + _param1_type param1; + typedef float _param2_type; + _param2_type param2; + typedef float _param3_type; + _param3_type param3; + typedef float _param4_type; + _param4_type param4; + typedef int32_t _x_type; + _x_type x; + typedef int32_t _y_type; + _y_type y; + typedef float _z_type; + _z_type z; + + CommandIntRequest(): + broadcast(0), + frame(0), + command(0), + current(0), + autocontinue(0), + param1(0), + param2(0), + param3(0), + param4(0), + x(0), + y(0), + z(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_broadcast; + u_broadcast.real = this->broadcast; + *(outbuffer + offset + 0) = (u_broadcast.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->broadcast); + *(outbuffer + offset + 0) = (this->frame >> (8 * 0)) & 0xFF; + offset += sizeof(this->frame); + *(outbuffer + offset + 0) = (this->command >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->command >> (8 * 1)) & 0xFF; + offset += sizeof(this->command); + *(outbuffer + offset + 0) = (this->current >> (8 * 0)) & 0xFF; + offset += sizeof(this->current); + *(outbuffer + offset + 0) = (this->autocontinue >> (8 * 0)) & 0xFF; + offset += sizeof(this->autocontinue); + union { + float real; + uint32_t base; + } u_param1; + u_param1.real = this->param1; + *(outbuffer + offset + 0) = (u_param1.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_param1.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_param1.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_param1.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->param1); + union { + float real; + uint32_t base; + } u_param2; + u_param2.real = this->param2; + *(outbuffer + offset + 0) = (u_param2.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_param2.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_param2.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_param2.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->param2); + union { + float real; + uint32_t base; + } u_param3; + u_param3.real = this->param3; + *(outbuffer + offset + 0) = (u_param3.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_param3.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_param3.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_param3.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->param3); + union { + float real; + uint32_t base; + } u_param4; + u_param4.real = this->param4; + *(outbuffer + offset + 0) = (u_param4.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_param4.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_param4.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_param4.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->param4); + union { + int32_t real; + uint32_t base; + } u_x; + u_x.real = this->x; + *(outbuffer + offset + 0) = (u_x.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_x.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_x.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_x.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->x); + union { + int32_t real; + uint32_t base; + } u_y; + u_y.real = this->y; + *(outbuffer + offset + 0) = (u_y.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_y.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_y.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_y.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->y); + union { + float real; + uint32_t base; + } u_z; + u_z.real = this->z; + *(outbuffer + offset + 0) = (u_z.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_z.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_z.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_z.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->z); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_broadcast; + u_broadcast.base = 0; + u_broadcast.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->broadcast = u_broadcast.real; + offset += sizeof(this->broadcast); + this->frame = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->frame); + this->command = ((uint16_t) (*(inbuffer + offset))); + this->command |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->command); + this->current = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->current); + this->autocontinue = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->autocontinue); + union { + float real; + uint32_t base; + } u_param1; + u_param1.base = 0; + u_param1.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_param1.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_param1.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_param1.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->param1 = u_param1.real; + offset += sizeof(this->param1); + union { + float real; + uint32_t base; + } u_param2; + u_param2.base = 0; + u_param2.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_param2.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_param2.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_param2.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->param2 = u_param2.real; + offset += sizeof(this->param2); + union { + float real; + uint32_t base; + } u_param3; + u_param3.base = 0; + u_param3.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_param3.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_param3.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_param3.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->param3 = u_param3.real; + offset += sizeof(this->param3); + union { + float real; + uint32_t base; + } u_param4; + u_param4.base = 0; + u_param4.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_param4.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_param4.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_param4.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->param4 = u_param4.real; + offset += sizeof(this->param4); + union { + int32_t real; + uint32_t base; + } u_x; + u_x.base = 0; + u_x.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->x = u_x.real; + offset += sizeof(this->x); + union { + int32_t real; + uint32_t base; + } u_y; + u_y.base = 0; + u_y.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->y = u_y.real; + offset += sizeof(this->y); + union { + float real; + uint32_t base; + } u_z; + u_z.base = 0; + u_z.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_z.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_z.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_z.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->z = u_z.real; + offset += sizeof(this->z); + return offset; + } + + virtual const char * getType() override { return COMMANDINT; }; + virtual const char * getMD5() override { return "6165959012c47e0f665b640c1ab12391"; }; + + }; + + class CommandIntResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + + CommandIntResponse(): + success(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + return offset; + } + + virtual const char * getType() override { return COMMANDINT; }; + virtual const char * getMD5() override { return "358e233cde0c8a8bcfea4ce193f8fc15"; }; + + }; + + class CommandInt { + public: + typedef CommandIntRequest Request; + typedef CommandIntResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/CommandLong.h b/pio_workspace/lib/ros_lib/mavros_msgs/CommandLong.h new file mode 100644 index 0000000..c463d47 --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/CommandLong.h @@ -0,0 +1,297 @@ +#ifndef _ROS_SERVICE_CommandLong_h +#define _ROS_SERVICE_CommandLong_h +#include +#include +#include +#include "ros/msg.h" + +namespace mavros_msgs +{ + +static const char COMMANDLONG[] = "mavros_msgs/CommandLong"; + + class CommandLongRequest : public ros::Msg + { + public: + typedef bool _broadcast_type; + _broadcast_type broadcast; + typedef uint16_t _command_type; + _command_type command; + typedef uint8_t _confirmation_type; + _confirmation_type confirmation; + typedef float _param1_type; + _param1_type param1; + typedef float _param2_type; + _param2_type param2; + typedef float _param3_type; + _param3_type param3; + typedef float _param4_type; + _param4_type param4; + typedef float _param5_type; + _param5_type param5; + typedef float _param6_type; + _param6_type param6; + typedef float _param7_type; + _param7_type param7; + + CommandLongRequest(): + broadcast(0), + command(0), + confirmation(0), + param1(0), + param2(0), + param3(0), + param4(0), + param5(0), + param6(0), + param7(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_broadcast; + u_broadcast.real = this->broadcast; + *(outbuffer + offset + 0) = (u_broadcast.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->broadcast); + *(outbuffer + offset + 0) = (this->command >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->command >> (8 * 1)) & 0xFF; + offset += sizeof(this->command); + *(outbuffer + offset + 0) = (this->confirmation >> (8 * 0)) & 0xFF; + offset += sizeof(this->confirmation); + union { + float real; + uint32_t base; + } u_param1; + u_param1.real = this->param1; + *(outbuffer + offset + 0) = (u_param1.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_param1.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_param1.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_param1.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->param1); + union { + float real; + uint32_t base; + } u_param2; + u_param2.real = this->param2; + *(outbuffer + offset + 0) = (u_param2.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_param2.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_param2.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_param2.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->param2); + union { + float real; + uint32_t base; + } u_param3; + u_param3.real = this->param3; + *(outbuffer + offset + 0) = (u_param3.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_param3.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_param3.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_param3.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->param3); + union { + float real; + uint32_t base; + } u_param4; + u_param4.real = this->param4; + *(outbuffer + offset + 0) = (u_param4.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_param4.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_param4.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_param4.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->param4); + union { + float real; + uint32_t base; + } u_param5; + u_param5.real = this->param5; + *(outbuffer + offset + 0) = (u_param5.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_param5.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_param5.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_param5.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->param5); + union { + float real; + uint32_t base; + } u_param6; + u_param6.real = this->param6; + *(outbuffer + offset + 0) = (u_param6.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_param6.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_param6.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_param6.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->param6); + union { + float real; + uint32_t base; + } u_param7; + u_param7.real = this->param7; + *(outbuffer + offset + 0) = (u_param7.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_param7.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_param7.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_param7.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->param7); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_broadcast; + u_broadcast.base = 0; + u_broadcast.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->broadcast = u_broadcast.real; + offset += sizeof(this->broadcast); + this->command = ((uint16_t) (*(inbuffer + offset))); + this->command |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->command); + this->confirmation = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->confirmation); + union { + float real; + uint32_t base; + } u_param1; + u_param1.base = 0; + u_param1.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_param1.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_param1.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_param1.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->param1 = u_param1.real; + offset += sizeof(this->param1); + union { + float real; + uint32_t base; + } u_param2; + u_param2.base = 0; + u_param2.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_param2.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_param2.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_param2.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->param2 = u_param2.real; + offset += sizeof(this->param2); + union { + float real; + uint32_t base; + } u_param3; + u_param3.base = 0; + u_param3.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_param3.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_param3.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_param3.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->param3 = u_param3.real; + offset += sizeof(this->param3); + union { + float real; + uint32_t base; + } u_param4; + u_param4.base = 0; + u_param4.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_param4.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_param4.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_param4.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->param4 = u_param4.real; + offset += sizeof(this->param4); + union { + float real; + uint32_t base; + } u_param5; + u_param5.base = 0; + u_param5.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_param5.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_param5.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_param5.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->param5 = u_param5.real; + offset += sizeof(this->param5); + union { + float real; + uint32_t base; + } u_param6; + u_param6.base = 0; + u_param6.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_param6.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_param6.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_param6.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->param6 = u_param6.real; + offset += sizeof(this->param6); + union { + float real; + uint32_t base; + } u_param7; + u_param7.base = 0; + u_param7.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_param7.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_param7.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_param7.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->param7 = u_param7.real; + offset += sizeof(this->param7); + return offset; + } + + virtual const char * getType() override { return COMMANDLONG; }; + virtual const char * getMD5() override { return "0ad16dd8ca2c8f209bfc6c32c71c0dd8"; }; + + }; + + class CommandLongResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + typedef uint8_t _result_type; + _result_type result; + + CommandLongResponse(): + success(0), + result(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + *(outbuffer + offset + 0) = (this->result >> (8 * 0)) & 0xFF; + offset += sizeof(this->result); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + this->result = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->result); + return offset; + } + + virtual const char * getType() override { return COMMANDLONG; }; + virtual const char * getMD5() override { return "1cd894375e4e3d2861d2222772894fdb"; }; + + }; + + class CommandLong { + public: + typedef CommandLongRequest Request; + typedef CommandLongResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/CommandTOL.h b/pio_workspace/lib/ros_lib/mavros_msgs/CommandTOL.h new file mode 100644 index 0000000..c628159 --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/CommandTOL.h @@ -0,0 +1,215 @@ +#ifndef _ROS_SERVICE_CommandTOL_h +#define _ROS_SERVICE_CommandTOL_h +#include +#include +#include +#include "ros/msg.h" + +namespace mavros_msgs +{ + +static const char COMMANDTOL[] = "mavros_msgs/CommandTOL"; + + class CommandTOLRequest : public ros::Msg + { + public: + typedef float _min_pitch_type; + _min_pitch_type min_pitch; + typedef float _yaw_type; + _yaw_type yaw; + typedef float _latitude_type; + _latitude_type latitude; + typedef float _longitude_type; + _longitude_type longitude; + typedef float _altitude_type; + _altitude_type altitude; + + CommandTOLRequest(): + min_pitch(0), + yaw(0), + latitude(0), + longitude(0), + altitude(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + float real; + uint32_t base; + } u_min_pitch; + u_min_pitch.real = this->min_pitch; + *(outbuffer + offset + 0) = (u_min_pitch.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_min_pitch.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_min_pitch.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_min_pitch.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->min_pitch); + union { + float real; + uint32_t base; + } u_yaw; + u_yaw.real = this->yaw; + *(outbuffer + offset + 0) = (u_yaw.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_yaw.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_yaw.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_yaw.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->yaw); + union { + float real; + uint32_t base; + } u_latitude; + u_latitude.real = this->latitude; + *(outbuffer + offset + 0) = (u_latitude.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_latitude.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_latitude.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_latitude.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->latitude); + union { + float real; + uint32_t base; + } u_longitude; + u_longitude.real = this->longitude; + *(outbuffer + offset + 0) = (u_longitude.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_longitude.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_longitude.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_longitude.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->longitude); + union { + float real; + uint32_t base; + } u_altitude; + u_altitude.real = this->altitude; + *(outbuffer + offset + 0) = (u_altitude.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_altitude.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_altitude.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_altitude.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->altitude); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + float real; + uint32_t base; + } u_min_pitch; + u_min_pitch.base = 0; + u_min_pitch.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_min_pitch.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_min_pitch.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_min_pitch.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->min_pitch = u_min_pitch.real; + offset += sizeof(this->min_pitch); + union { + float real; + uint32_t base; + } u_yaw; + u_yaw.base = 0; + u_yaw.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_yaw.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_yaw.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_yaw.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->yaw = u_yaw.real; + offset += sizeof(this->yaw); + union { + float real; + uint32_t base; + } u_latitude; + u_latitude.base = 0; + u_latitude.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_latitude.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_latitude.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_latitude.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->latitude = u_latitude.real; + offset += sizeof(this->latitude); + union { + float real; + uint32_t base; + } u_longitude; + u_longitude.base = 0; + u_longitude.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_longitude.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_longitude.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_longitude.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->longitude = u_longitude.real; + offset += sizeof(this->longitude); + union { + float real; + uint32_t base; + } u_altitude; + u_altitude.base = 0; + u_altitude.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_altitude.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_altitude.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_altitude.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->altitude = u_altitude.real; + offset += sizeof(this->altitude); + return offset; + } + + virtual const char * getType() override { return COMMANDTOL; }; + virtual const char * getMD5() override { return "5aec7e34bcfe9ec68949aebae7bcd1ec"; }; + + }; + + class CommandTOLResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + typedef uint8_t _result_type; + _result_type result; + + CommandTOLResponse(): + success(0), + result(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + *(outbuffer + offset + 0) = (this->result >> (8 * 0)) & 0xFF; + offset += sizeof(this->result); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + this->result = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->result); + return offset; + } + + virtual const char * getType() override { return COMMANDTOL; }; + virtual const char * getMD5() override { return "1cd894375e4e3d2861d2222772894fdb"; }; + + }; + + class CommandTOL { + public: + typedef CommandTOLRequest Request; + typedef CommandTOLResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/CommandTriggerControl.h b/pio_workspace/lib/ros_lib/mavros_msgs/CommandTriggerControl.h new file mode 100644 index 0000000..4006fc4 --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/CommandTriggerControl.h @@ -0,0 +1,149 @@ +#ifndef _ROS_SERVICE_CommandTriggerControl_h +#define _ROS_SERVICE_CommandTriggerControl_h +#include +#include +#include +#include "ros/msg.h" + +namespace mavros_msgs +{ + +static const char COMMANDTRIGGERCONTROL[] = "mavros_msgs/CommandTriggerControl"; + + class CommandTriggerControlRequest : public ros::Msg + { + public: + typedef bool _trigger_enable_type; + _trigger_enable_type trigger_enable; + typedef bool _sequence_reset_type; + _sequence_reset_type sequence_reset; + typedef bool _trigger_pause_type; + _trigger_pause_type trigger_pause; + + CommandTriggerControlRequest(): + trigger_enable(0), + sequence_reset(0), + trigger_pause(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_trigger_enable; + u_trigger_enable.real = this->trigger_enable; + *(outbuffer + offset + 0) = (u_trigger_enable.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->trigger_enable); + union { + bool real; + uint8_t base; + } u_sequence_reset; + u_sequence_reset.real = this->sequence_reset; + *(outbuffer + offset + 0) = (u_sequence_reset.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->sequence_reset); + union { + bool real; + uint8_t base; + } u_trigger_pause; + u_trigger_pause.real = this->trigger_pause; + *(outbuffer + offset + 0) = (u_trigger_pause.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->trigger_pause); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_trigger_enable; + u_trigger_enable.base = 0; + u_trigger_enable.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->trigger_enable = u_trigger_enable.real; + offset += sizeof(this->trigger_enable); + union { + bool real; + uint8_t base; + } u_sequence_reset; + u_sequence_reset.base = 0; + u_sequence_reset.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->sequence_reset = u_sequence_reset.real; + offset += sizeof(this->sequence_reset); + union { + bool real; + uint8_t base; + } u_trigger_pause; + u_trigger_pause.base = 0; + u_trigger_pause.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->trigger_pause = u_trigger_pause.real; + offset += sizeof(this->trigger_pause); + return offset; + } + + virtual const char * getType() override { return COMMANDTRIGGERCONTROL; }; + virtual const char * getMD5() override { return "5231f3f21be52f9682a8e030770339a5"; }; + + }; + + class CommandTriggerControlResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + typedef uint8_t _result_type; + _result_type result; + + CommandTriggerControlResponse(): + success(0), + result(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + *(outbuffer + offset + 0) = (this->result >> (8 * 0)) & 0xFF; + offset += sizeof(this->result); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + this->result = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->result); + return offset; + } + + virtual const char * getType() override { return COMMANDTRIGGERCONTROL; }; + virtual const char * getMD5() override { return "1cd894375e4e3d2861d2222772894fdb"; }; + + }; + + class CommandTriggerControl { + public: + typedef CommandTriggerControlRequest Request; + typedef CommandTriggerControlResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/CommandTriggerInterval.h b/pio_workspace/lib/ros_lib/mavros_msgs/CommandTriggerInterval.h new file mode 100644 index 0000000..f06ab86 --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/CommandTriggerInterval.h @@ -0,0 +1,143 @@ +#ifndef _ROS_SERVICE_CommandTriggerInterval_h +#define _ROS_SERVICE_CommandTriggerInterval_h +#include +#include +#include +#include "ros/msg.h" + +namespace mavros_msgs +{ + +static const char COMMANDTRIGGERINTERVAL[] = "mavros_msgs/CommandTriggerInterval"; + + class CommandTriggerIntervalRequest : public ros::Msg + { + public: + typedef float _cycle_time_type; + _cycle_time_type cycle_time; + typedef float _integration_time_type; + _integration_time_type integration_time; + + CommandTriggerIntervalRequest(): + cycle_time(0), + integration_time(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + float real; + uint32_t base; + } u_cycle_time; + u_cycle_time.real = this->cycle_time; + *(outbuffer + offset + 0) = (u_cycle_time.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_cycle_time.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_cycle_time.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_cycle_time.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->cycle_time); + union { + float real; + uint32_t base; + } u_integration_time; + u_integration_time.real = this->integration_time; + *(outbuffer + offset + 0) = (u_integration_time.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_integration_time.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_integration_time.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_integration_time.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->integration_time); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + float real; + uint32_t base; + } u_cycle_time; + u_cycle_time.base = 0; + u_cycle_time.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_cycle_time.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_cycle_time.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_cycle_time.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->cycle_time = u_cycle_time.real; + offset += sizeof(this->cycle_time); + union { + float real; + uint32_t base; + } u_integration_time; + u_integration_time.base = 0; + u_integration_time.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_integration_time.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_integration_time.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_integration_time.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->integration_time = u_integration_time.real; + offset += sizeof(this->integration_time); + return offset; + } + + virtual const char * getType() override { return COMMANDTRIGGERINTERVAL; }; + virtual const char * getMD5() override { return "54f6167a076ced593aa096ea6eb1a519"; }; + + }; + + class CommandTriggerIntervalResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + typedef uint8_t _result_type; + _result_type result; + + CommandTriggerIntervalResponse(): + success(0), + result(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + *(outbuffer + offset + 0) = (this->result >> (8 * 0)) & 0xFF; + offset += sizeof(this->result); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + this->result = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->result); + return offset; + } + + virtual const char * getType() override { return COMMANDTRIGGERINTERVAL; }; + virtual const char * getMD5() override { return "1cd894375e4e3d2861d2222772894fdb"; }; + + }; + + class CommandTriggerInterval { + public: + typedef CommandTriggerIntervalRequest Request; + typedef CommandTriggerIntervalResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/CommandVtolTransition.h b/pio_workspace/lib/ros_lib/mavros_msgs/CommandVtolTransition.h new file mode 100644 index 0000000..8e21a17 --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/CommandVtolTransition.h @@ -0,0 +1,110 @@ +#ifndef _ROS_SERVICE_CommandVtolTransition_h +#define _ROS_SERVICE_CommandVtolTransition_h +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace mavros_msgs +{ + +static const char COMMANDVTOLTRANSITION[] = "mavros_msgs/CommandVtolTransition"; + + class CommandVtolTransitionRequest : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef uint8_t _state_type; + _state_type state; + enum { STATE_MC = 3 }; + enum { STATE_FW = 4 }; + + CommandVtolTransitionRequest(): + header(), + state(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->state >> (8 * 0)) & 0xFF; + offset += sizeof(this->state); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + this->state = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->state); + return offset; + } + + virtual const char * getType() override { return COMMANDVTOLTRANSITION; }; + virtual const char * getMD5() override { return "0f073c606cdf8c014b856a5033900f3e"; }; + + }; + + class CommandVtolTransitionResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + typedef uint8_t _result_type; + _result_type result; + + CommandVtolTransitionResponse(): + success(0), + result(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + *(outbuffer + offset + 0) = (this->result >> (8 * 0)) & 0xFF; + offset += sizeof(this->result); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + this->result = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->result); + return offset; + } + + virtual const char * getType() override { return COMMANDVTOLTRANSITION; }; + virtual const char * getMD5() override { return "1cd894375e4e3d2861d2222772894fdb"; }; + + }; + + class CommandVtolTransition { + public: + typedef CommandVtolTransitionRequest Request; + typedef CommandVtolTransitionResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/CompanionProcessStatus.h b/pio_workspace/lib/ros_lib/mavros_msgs/CompanionProcessStatus.h new file mode 100644 index 0000000..76abdbd --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/CompanionProcessStatus.h @@ -0,0 +1,69 @@ +#ifndef _ROS_mavros_msgs_CompanionProcessStatus_h +#define _ROS_mavros_msgs_CompanionProcessStatus_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace mavros_msgs +{ + + class CompanionProcessStatus : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef uint8_t _state_type; + _state_type state; + typedef uint8_t _component_type; + _component_type component; + enum { MAV_STATE_UNINIT = 0 }; + enum { MAV_STATE_BOOT = 1 }; + enum { MAV_STATE_CALIBRATING = 2 }; + enum { MAV_STATE_STANDBY = 3 }; + enum { MAV_STATE_ACTIVE = 4 }; + enum { MAV_STATE_CRITICAL = 5 }; + enum { MAV_STATE_EMERGENCY = 6 }; + enum { MAV_STATE_POWEROFF = 7 }; + enum { MAV_STATE_FLIGHT_TERMINATION = 8 }; + enum { MAV_COMP_ID_OBSTACLE_AVOIDANCE = 196 }; + enum { MAV_COMP_ID_VISUAL_INERTIAL_ODOMETRY = 197 }; + + CompanionProcessStatus(): + header(), + state(0), + component(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->state >> (8 * 0)) & 0xFF; + offset += sizeof(this->state); + *(outbuffer + offset + 0) = (this->component >> (8 * 0)) & 0xFF; + offset += sizeof(this->component); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + this->state = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->state); + this->component = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->component); + return offset; + } + + virtual const char * getType() override { return "mavros_msgs/CompanionProcessStatus"; }; + virtual const char * getMD5() override { return "b6dd787fcd873e87778987b1845f4cb5"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/DebugValue.h b/pio_workspace/lib/ros_lib/mavros_msgs/DebugValue.h new file mode 100644 index 0000000..f7966b4 --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/DebugValue.h @@ -0,0 +1,213 @@ +#ifndef _ROS_mavros_msgs_DebugValue_h +#define _ROS_mavros_msgs_DebugValue_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace mavros_msgs +{ + + class DebugValue : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef int32_t _index_type; + _index_type index; + typedef int32_t _array_id_type; + _array_id_type array_id; + typedef const char* _name_type; + _name_type name; + typedef float _value_float_type; + _value_float_type value_float; + typedef int32_t _value_int_type; + _value_int_type value_int; + uint32_t data_length; + typedef float _data_type; + _data_type st_data; + _data_type * data; + typedef uint8_t _type_type; + _type_type type; + enum { TYPE_DEBUG = 0 }; + enum { TYPE_DEBUG_VECT = 1 }; + enum { TYPE_DEBUG_FLOAT_ARRAY = 2 }; + enum { TYPE_NAMED_VALUE_FLOAT = 3 }; + enum { TYPE_NAMED_VALUE_INT = 4 }; + + DebugValue(): + header(), + index(0), + array_id(0), + name(""), + value_float(0), + value_int(0), + data_length(0), st_data(), data(nullptr), + type(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + union { + int32_t real; + uint32_t base; + } u_index; + u_index.real = this->index; + *(outbuffer + offset + 0) = (u_index.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_index.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_index.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_index.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->index); + union { + int32_t real; + uint32_t base; + } u_array_id; + u_array_id.real = this->array_id; + *(outbuffer + offset + 0) = (u_array_id.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_array_id.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_array_id.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_array_id.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->array_id); + uint32_t length_name = strlen(this->name); + varToArr(outbuffer + offset, length_name); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + union { + float real; + uint32_t base; + } u_value_float; + u_value_float.real = this->value_float; + *(outbuffer + offset + 0) = (u_value_float.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_value_float.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_value_float.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_value_float.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->value_float); + union { + int32_t real; + uint32_t base; + } u_value_int; + u_value_int.real = this->value_int; + *(outbuffer + offset + 0) = (u_value_int.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_value_int.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_value_int.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_value_int.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->value_int); + *(outbuffer + offset + 0) = (this->data_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->data_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->data_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->data_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->data_length); + for( uint32_t i = 0; i < data_length; i++){ + union { + float real; + uint32_t base; + } u_datai; + u_datai.real = this->data[i]; + *(outbuffer + offset + 0) = (u_datai.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_datai.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_datai.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_datai.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->data[i]); + } + *(outbuffer + offset + 0) = (this->type >> (8 * 0)) & 0xFF; + offset += sizeof(this->type); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + union { + int32_t real; + uint32_t base; + } u_index; + u_index.base = 0; + u_index.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_index.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_index.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_index.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->index = u_index.real; + offset += sizeof(this->index); + union { + int32_t real; + uint32_t base; + } u_array_id; + u_array_id.base = 0; + u_array_id.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_array_id.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_array_id.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_array_id.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->array_id = u_array_id.real; + offset += sizeof(this->array_id); + uint32_t length_name; + arrToVar(length_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + union { + float real; + uint32_t base; + } u_value_float; + u_value_float.base = 0; + u_value_float.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_value_float.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_value_float.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_value_float.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->value_float = u_value_float.real; + offset += sizeof(this->value_float); + union { + int32_t real; + uint32_t base; + } u_value_int; + u_value_int.base = 0; + u_value_int.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_value_int.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_value_int.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_value_int.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->value_int = u_value_int.real; + offset += sizeof(this->value_int); + uint32_t data_lengthT = ((uint32_t) (*(inbuffer + offset))); + data_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + data_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + data_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->data_length); + if(data_lengthT > data_length) + this->data = (float*)realloc(this->data, data_lengthT * sizeof(float)); + data_length = data_lengthT; + for( uint32_t i = 0; i < data_length; i++){ + union { + float real; + uint32_t base; + } u_st_data; + u_st_data.base = 0; + u_st_data.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_data.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_data.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_data.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_data = u_st_data.real; + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(float)); + } + this->type = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->type); + return offset; + } + + virtual const char * getType() override { return "mavros_msgs/DebugValue"; }; + virtual const char * getMD5() override { return "a385507a0141af80b5f68662747f1e68"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/ESCInfo.h b/pio_workspace/lib/ros_lib/mavros_msgs/ESCInfo.h new file mode 100644 index 0000000..0294cdb --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/ESCInfo.h @@ -0,0 +1,100 @@ +#ifndef _ROS_mavros_msgs_ESCInfo_h +#define _ROS_mavros_msgs_ESCInfo_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "mavros_msgs/ESCInfoItem.h" + +namespace mavros_msgs +{ + + class ESCInfo : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef uint16_t _counter_type; + _counter_type counter; + typedef uint8_t _count_type; + _count_type count; + typedef uint8_t _connection_type_type; + _connection_type_type connection_type; + typedef uint8_t _info_type; + _info_type info; + uint32_t esc_info_length; + typedef mavros_msgs::ESCInfoItem _esc_info_type; + _esc_info_type st_esc_info; + _esc_info_type * esc_info; + + ESCInfo(): + header(), + counter(0), + count(0), + connection_type(0), + info(0), + esc_info_length(0), st_esc_info(), esc_info(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->counter >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->counter >> (8 * 1)) & 0xFF; + offset += sizeof(this->counter); + *(outbuffer + offset + 0) = (this->count >> (8 * 0)) & 0xFF; + offset += sizeof(this->count); + *(outbuffer + offset + 0) = (this->connection_type >> (8 * 0)) & 0xFF; + offset += sizeof(this->connection_type); + *(outbuffer + offset + 0) = (this->info >> (8 * 0)) & 0xFF; + offset += sizeof(this->info); + *(outbuffer + offset + 0) = (this->esc_info_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->esc_info_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->esc_info_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->esc_info_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->esc_info_length); + for( uint32_t i = 0; i < esc_info_length; i++){ + offset += this->esc_info[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + this->counter = ((uint16_t) (*(inbuffer + offset))); + this->counter |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->counter); + this->count = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->count); + this->connection_type = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->connection_type); + this->info = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->info); + uint32_t esc_info_lengthT = ((uint32_t) (*(inbuffer + offset))); + esc_info_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + esc_info_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + esc_info_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->esc_info_length); + if(esc_info_lengthT > esc_info_length) + this->esc_info = (mavros_msgs::ESCInfoItem*)realloc(this->esc_info, esc_info_lengthT * sizeof(mavros_msgs::ESCInfoItem)); + esc_info_length = esc_info_lengthT; + for( uint32_t i = 0; i < esc_info_length; i++){ + offset += this->st_esc_info.deserialize(inbuffer + offset); + memcpy( &(this->esc_info[i]), &(this->st_esc_info), sizeof(mavros_msgs::ESCInfoItem)); + } + return offset; + } + + virtual const char * getType() override { return "mavros_msgs/ESCInfo"; }; + virtual const char * getMD5() override { return "63fa145856ba5b9bdcaf4b1f55eaa549"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/ESCInfoItem.h b/pio_workspace/lib/ros_lib/mavros_msgs/ESCInfoItem.h new file mode 100644 index 0000000..3c92c60 --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/ESCInfoItem.h @@ -0,0 +1,90 @@ +#ifndef _ROS_mavros_msgs_ESCInfoItem_h +#define _ROS_mavros_msgs_ESCInfoItem_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace mavros_msgs +{ + + class ESCInfoItem : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef uint16_t _failure_flags_type; + _failure_flags_type failure_flags; + typedef uint32_t _error_count_type; + _error_count_type error_count; + typedef int32_t _temperature_type; + _temperature_type temperature; + + ESCInfoItem(): + header(), + failure_flags(0), + error_count(0), + temperature(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->failure_flags >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->failure_flags >> (8 * 1)) & 0xFF; + offset += sizeof(this->failure_flags); + *(outbuffer + offset + 0) = (this->error_count >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->error_count >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->error_count >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->error_count >> (8 * 3)) & 0xFF; + offset += sizeof(this->error_count); + union { + int32_t real; + uint32_t base; + } u_temperature; + u_temperature.real = this->temperature; + *(outbuffer + offset + 0) = (u_temperature.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_temperature.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_temperature.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_temperature.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->temperature); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + this->failure_flags = ((uint16_t) (*(inbuffer + offset))); + this->failure_flags |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->failure_flags); + this->error_count = ((uint32_t) (*(inbuffer + offset))); + this->error_count |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->error_count |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->error_count |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->error_count); + union { + int32_t real; + uint32_t base; + } u_temperature; + u_temperature.base = 0; + u_temperature.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_temperature.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_temperature.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_temperature.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->temperature = u_temperature.real; + offset += sizeof(this->temperature); + return offset; + } + + virtual const char * getType() override { return "mavros_msgs/ESCInfoItem"; }; + virtual const char * getMD5() override { return "968983ff768dda90f04c5aa11caf6e74"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/ESCStatus.h b/pio_workspace/lib/ros_lib/mavros_msgs/ESCStatus.h new file mode 100644 index 0000000..c8ec2a5 --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/ESCStatus.h @@ -0,0 +1,70 @@ +#ifndef _ROS_mavros_msgs_ESCStatus_h +#define _ROS_mavros_msgs_ESCStatus_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "mavros_msgs/ESCStatusItem.h" + +namespace mavros_msgs +{ + + class ESCStatus : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t esc_status_length; + typedef mavros_msgs::ESCStatusItem _esc_status_type; + _esc_status_type st_esc_status; + _esc_status_type * esc_status; + + ESCStatus(): + header(), + esc_status_length(0), st_esc_status(), esc_status(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->esc_status_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->esc_status_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->esc_status_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->esc_status_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->esc_status_length); + for( uint32_t i = 0; i < esc_status_length; i++){ + offset += this->esc_status[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t esc_status_lengthT = ((uint32_t) (*(inbuffer + offset))); + esc_status_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + esc_status_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + esc_status_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->esc_status_length); + if(esc_status_lengthT > esc_status_length) + this->esc_status = (mavros_msgs::ESCStatusItem*)realloc(this->esc_status, esc_status_lengthT * sizeof(mavros_msgs::ESCStatusItem)); + esc_status_length = esc_status_lengthT; + for( uint32_t i = 0; i < esc_status_length; i++){ + offset += this->st_esc_status.deserialize(inbuffer + offset); + memcpy( &(this->esc_status[i]), &(this->st_esc_status), sizeof(mavros_msgs::ESCStatusItem)); + } + return offset; + } + + virtual const char * getType() override { return "mavros_msgs/ESCStatus"; }; + virtual const char * getMD5() override { return "145d49eaf5cfecbdfd50ae4a22fe82d4"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/ESCStatusItem.h b/pio_workspace/lib/ros_lib/mavros_msgs/ESCStatusItem.h new file mode 100644 index 0000000..a21bd06 --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/ESCStatusItem.h @@ -0,0 +1,116 @@ +#ifndef _ROS_mavros_msgs_ESCStatusItem_h +#define _ROS_mavros_msgs_ESCStatusItem_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace mavros_msgs +{ + + class ESCStatusItem : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef int32_t _rpm_type; + _rpm_type rpm; + typedef float _voltage_type; + _voltage_type voltage; + typedef float _current_type; + _current_type current; + + ESCStatusItem(): + header(), + rpm(0), + voltage(0), + current(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + union { + int32_t real; + uint32_t base; + } u_rpm; + u_rpm.real = this->rpm; + *(outbuffer + offset + 0) = (u_rpm.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_rpm.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_rpm.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_rpm.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->rpm); + union { + float real; + uint32_t base; + } u_voltage; + u_voltage.real = this->voltage; + *(outbuffer + offset + 0) = (u_voltage.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_voltage.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_voltage.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_voltage.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->voltage); + union { + float real; + uint32_t base; + } u_current; + u_current.real = this->current; + *(outbuffer + offset + 0) = (u_current.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_current.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_current.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_current.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->current); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + union { + int32_t real; + uint32_t base; + } u_rpm; + u_rpm.base = 0; + u_rpm.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_rpm.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_rpm.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_rpm.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->rpm = u_rpm.real; + offset += sizeof(this->rpm); + union { + float real; + uint32_t base; + } u_voltage; + u_voltage.base = 0; + u_voltage.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_voltage.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_voltage.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_voltage.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->voltage = u_voltage.real; + offset += sizeof(this->voltage); + union { + float real; + uint32_t base; + } u_current; + u_current.base = 0; + u_current.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_current.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_current.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_current.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->current = u_current.real; + offset += sizeof(this->current); + return offset; + } + + virtual const char * getType() override { return "mavros_msgs/ESCStatusItem"; }; + virtual const char * getMD5() override { return "70651ef564857ec47d6e23206e2f7145"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/ESCTelemetry.h b/pio_workspace/lib/ros_lib/mavros_msgs/ESCTelemetry.h new file mode 100644 index 0000000..2b32775 --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/ESCTelemetry.h @@ -0,0 +1,70 @@ +#ifndef _ROS_mavros_msgs_ESCTelemetry_h +#define _ROS_mavros_msgs_ESCTelemetry_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "mavros_msgs/ESCTelemetryItem.h" + +namespace mavros_msgs +{ + + class ESCTelemetry : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t esc_telemetry_length; + typedef mavros_msgs::ESCTelemetryItem _esc_telemetry_type; + _esc_telemetry_type st_esc_telemetry; + _esc_telemetry_type * esc_telemetry; + + ESCTelemetry(): + header(), + esc_telemetry_length(0), st_esc_telemetry(), esc_telemetry(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->esc_telemetry_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->esc_telemetry_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->esc_telemetry_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->esc_telemetry_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->esc_telemetry_length); + for( uint32_t i = 0; i < esc_telemetry_length; i++){ + offset += this->esc_telemetry[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t esc_telemetry_lengthT = ((uint32_t) (*(inbuffer + offset))); + esc_telemetry_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + esc_telemetry_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + esc_telemetry_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->esc_telemetry_length); + if(esc_telemetry_lengthT > esc_telemetry_length) + this->esc_telemetry = (mavros_msgs::ESCTelemetryItem*)realloc(this->esc_telemetry, esc_telemetry_lengthT * sizeof(mavros_msgs::ESCTelemetryItem)); + esc_telemetry_length = esc_telemetry_lengthT; + for( uint32_t i = 0; i < esc_telemetry_length; i++){ + offset += this->st_esc_telemetry.deserialize(inbuffer + offset); + memcpy( &(this->esc_telemetry[i]), &(this->st_esc_telemetry), sizeof(mavros_msgs::ESCTelemetryItem)); + } + return offset; + } + + virtual const char * getType() override { return "mavros_msgs/ESCTelemetry"; }; + virtual const char * getMD5() override { return "7b1fb252ca6aa175fe8dd23d029b3362"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/ESCTelemetryItem.h b/pio_workspace/lib/ros_lib/mavros_msgs/ESCTelemetryItem.h new file mode 100644 index 0000000..4771689 --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/ESCTelemetryItem.h @@ -0,0 +1,173 @@ +#ifndef _ROS_mavros_msgs_ESCTelemetryItem_h +#define _ROS_mavros_msgs_ESCTelemetryItem_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace mavros_msgs +{ + + class ESCTelemetryItem : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef float _temperature_type; + _temperature_type temperature; + typedef float _voltage_type; + _voltage_type voltage; + typedef float _current_type; + _current_type current; + typedef float _totalcurrent_type; + _totalcurrent_type totalcurrent; + typedef int32_t _rpm_type; + _rpm_type rpm; + typedef uint16_t _count_type; + _count_type count; + + ESCTelemetryItem(): + header(), + temperature(0), + voltage(0), + current(0), + totalcurrent(0), + rpm(0), + count(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + union { + float real; + uint32_t base; + } u_temperature; + u_temperature.real = this->temperature; + *(outbuffer + offset + 0) = (u_temperature.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_temperature.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_temperature.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_temperature.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->temperature); + union { + float real; + uint32_t base; + } u_voltage; + u_voltage.real = this->voltage; + *(outbuffer + offset + 0) = (u_voltage.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_voltage.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_voltage.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_voltage.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->voltage); + union { + float real; + uint32_t base; + } u_current; + u_current.real = this->current; + *(outbuffer + offset + 0) = (u_current.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_current.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_current.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_current.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->current); + union { + float real; + uint32_t base; + } u_totalcurrent; + u_totalcurrent.real = this->totalcurrent; + *(outbuffer + offset + 0) = (u_totalcurrent.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_totalcurrent.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_totalcurrent.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_totalcurrent.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->totalcurrent); + union { + int32_t real; + uint32_t base; + } u_rpm; + u_rpm.real = this->rpm; + *(outbuffer + offset + 0) = (u_rpm.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_rpm.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_rpm.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_rpm.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->rpm); + *(outbuffer + offset + 0) = (this->count >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->count >> (8 * 1)) & 0xFF; + offset += sizeof(this->count); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + union { + float real; + uint32_t base; + } u_temperature; + u_temperature.base = 0; + u_temperature.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_temperature.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_temperature.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_temperature.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->temperature = u_temperature.real; + offset += sizeof(this->temperature); + union { + float real; + uint32_t base; + } u_voltage; + u_voltage.base = 0; + u_voltage.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_voltage.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_voltage.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_voltage.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->voltage = u_voltage.real; + offset += sizeof(this->voltage); + union { + float real; + uint32_t base; + } u_current; + u_current.base = 0; + u_current.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_current.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_current.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_current.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->current = u_current.real; + offset += sizeof(this->current); + union { + float real; + uint32_t base; + } u_totalcurrent; + u_totalcurrent.base = 0; + u_totalcurrent.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_totalcurrent.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_totalcurrent.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_totalcurrent.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->totalcurrent = u_totalcurrent.real; + offset += sizeof(this->totalcurrent); + union { + int32_t real; + uint32_t base; + } u_rpm; + u_rpm.base = 0; + u_rpm.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_rpm.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_rpm.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_rpm.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->rpm = u_rpm.real; + offset += sizeof(this->rpm); + this->count = ((uint16_t) (*(inbuffer + offset))); + this->count |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->count); + return offset; + } + + virtual const char * getType() override { return "mavros_msgs/ESCTelemetryItem"; }; + virtual const char * getMD5() override { return "a135c5d0c71a3bade75476291a42a6df"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/EstimatorStatus.h b/pio_workspace/lib/ros_lib/mavros_msgs/EstimatorStatus.h new file mode 100644 index 0000000..4cb7f0e --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/EstimatorStatus.h @@ -0,0 +1,260 @@ +#ifndef _ROS_mavros_msgs_EstimatorStatus_h +#define _ROS_mavros_msgs_EstimatorStatus_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace mavros_msgs +{ + + class EstimatorStatus : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef bool _attitude_status_flag_type; + _attitude_status_flag_type attitude_status_flag; + typedef bool _velocity_horiz_status_flag_type; + _velocity_horiz_status_flag_type velocity_horiz_status_flag; + typedef bool _velocity_vert_status_flag_type; + _velocity_vert_status_flag_type velocity_vert_status_flag; + typedef bool _pos_horiz_rel_status_flag_type; + _pos_horiz_rel_status_flag_type pos_horiz_rel_status_flag; + typedef bool _pos_horiz_abs_status_flag_type; + _pos_horiz_abs_status_flag_type pos_horiz_abs_status_flag; + typedef bool _pos_vert_abs_status_flag_type; + _pos_vert_abs_status_flag_type pos_vert_abs_status_flag; + typedef bool _pos_vert_agl_status_flag_type; + _pos_vert_agl_status_flag_type pos_vert_agl_status_flag; + typedef bool _const_pos_mode_status_flag_type; + _const_pos_mode_status_flag_type const_pos_mode_status_flag; + typedef bool _pred_pos_horiz_rel_status_flag_type; + _pred_pos_horiz_rel_status_flag_type pred_pos_horiz_rel_status_flag; + typedef bool _pred_pos_horiz_abs_status_flag_type; + _pred_pos_horiz_abs_status_flag_type pred_pos_horiz_abs_status_flag; + typedef bool _gps_glitch_status_flag_type; + _gps_glitch_status_flag_type gps_glitch_status_flag; + typedef bool _accel_error_status_flag_type; + _accel_error_status_flag_type accel_error_status_flag; + + EstimatorStatus(): + header(), + attitude_status_flag(0), + velocity_horiz_status_flag(0), + velocity_vert_status_flag(0), + pos_horiz_rel_status_flag(0), + pos_horiz_abs_status_flag(0), + pos_vert_abs_status_flag(0), + pos_vert_agl_status_flag(0), + const_pos_mode_status_flag(0), + pred_pos_horiz_rel_status_flag(0), + pred_pos_horiz_abs_status_flag(0), + gps_glitch_status_flag(0), + accel_error_status_flag(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + union { + bool real; + uint8_t base; + } u_attitude_status_flag; + u_attitude_status_flag.real = this->attitude_status_flag; + *(outbuffer + offset + 0) = (u_attitude_status_flag.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->attitude_status_flag); + union { + bool real; + uint8_t base; + } u_velocity_horiz_status_flag; + u_velocity_horiz_status_flag.real = this->velocity_horiz_status_flag; + *(outbuffer + offset + 0) = (u_velocity_horiz_status_flag.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->velocity_horiz_status_flag); + union { + bool real; + uint8_t base; + } u_velocity_vert_status_flag; + u_velocity_vert_status_flag.real = this->velocity_vert_status_flag; + *(outbuffer + offset + 0) = (u_velocity_vert_status_flag.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->velocity_vert_status_flag); + union { + bool real; + uint8_t base; + } u_pos_horiz_rel_status_flag; + u_pos_horiz_rel_status_flag.real = this->pos_horiz_rel_status_flag; + *(outbuffer + offset + 0) = (u_pos_horiz_rel_status_flag.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->pos_horiz_rel_status_flag); + union { + bool real; + uint8_t base; + } u_pos_horiz_abs_status_flag; + u_pos_horiz_abs_status_flag.real = this->pos_horiz_abs_status_flag; + *(outbuffer + offset + 0) = (u_pos_horiz_abs_status_flag.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->pos_horiz_abs_status_flag); + union { + bool real; + uint8_t base; + } u_pos_vert_abs_status_flag; + u_pos_vert_abs_status_flag.real = this->pos_vert_abs_status_flag; + *(outbuffer + offset + 0) = (u_pos_vert_abs_status_flag.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->pos_vert_abs_status_flag); + union { + bool real; + uint8_t base; + } u_pos_vert_agl_status_flag; + u_pos_vert_agl_status_flag.real = this->pos_vert_agl_status_flag; + *(outbuffer + offset + 0) = (u_pos_vert_agl_status_flag.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->pos_vert_agl_status_flag); + union { + bool real; + uint8_t base; + } u_const_pos_mode_status_flag; + u_const_pos_mode_status_flag.real = this->const_pos_mode_status_flag; + *(outbuffer + offset + 0) = (u_const_pos_mode_status_flag.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->const_pos_mode_status_flag); + union { + bool real; + uint8_t base; + } u_pred_pos_horiz_rel_status_flag; + u_pred_pos_horiz_rel_status_flag.real = this->pred_pos_horiz_rel_status_flag; + *(outbuffer + offset + 0) = (u_pred_pos_horiz_rel_status_flag.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->pred_pos_horiz_rel_status_flag); + union { + bool real; + uint8_t base; + } u_pred_pos_horiz_abs_status_flag; + u_pred_pos_horiz_abs_status_flag.real = this->pred_pos_horiz_abs_status_flag; + *(outbuffer + offset + 0) = (u_pred_pos_horiz_abs_status_flag.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->pred_pos_horiz_abs_status_flag); + union { + bool real; + uint8_t base; + } u_gps_glitch_status_flag; + u_gps_glitch_status_flag.real = this->gps_glitch_status_flag; + *(outbuffer + offset + 0) = (u_gps_glitch_status_flag.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->gps_glitch_status_flag); + union { + bool real; + uint8_t base; + } u_accel_error_status_flag; + u_accel_error_status_flag.real = this->accel_error_status_flag; + *(outbuffer + offset + 0) = (u_accel_error_status_flag.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->accel_error_status_flag); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + union { + bool real; + uint8_t base; + } u_attitude_status_flag; + u_attitude_status_flag.base = 0; + u_attitude_status_flag.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->attitude_status_flag = u_attitude_status_flag.real; + offset += sizeof(this->attitude_status_flag); + union { + bool real; + uint8_t base; + } u_velocity_horiz_status_flag; + u_velocity_horiz_status_flag.base = 0; + u_velocity_horiz_status_flag.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->velocity_horiz_status_flag = u_velocity_horiz_status_flag.real; + offset += sizeof(this->velocity_horiz_status_flag); + union { + bool real; + uint8_t base; + } u_velocity_vert_status_flag; + u_velocity_vert_status_flag.base = 0; + u_velocity_vert_status_flag.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->velocity_vert_status_flag = u_velocity_vert_status_flag.real; + offset += sizeof(this->velocity_vert_status_flag); + union { + bool real; + uint8_t base; + } u_pos_horiz_rel_status_flag; + u_pos_horiz_rel_status_flag.base = 0; + u_pos_horiz_rel_status_flag.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->pos_horiz_rel_status_flag = u_pos_horiz_rel_status_flag.real; + offset += sizeof(this->pos_horiz_rel_status_flag); + union { + bool real; + uint8_t base; + } u_pos_horiz_abs_status_flag; + u_pos_horiz_abs_status_flag.base = 0; + u_pos_horiz_abs_status_flag.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->pos_horiz_abs_status_flag = u_pos_horiz_abs_status_flag.real; + offset += sizeof(this->pos_horiz_abs_status_flag); + union { + bool real; + uint8_t base; + } u_pos_vert_abs_status_flag; + u_pos_vert_abs_status_flag.base = 0; + u_pos_vert_abs_status_flag.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->pos_vert_abs_status_flag = u_pos_vert_abs_status_flag.real; + offset += sizeof(this->pos_vert_abs_status_flag); + union { + bool real; + uint8_t base; + } u_pos_vert_agl_status_flag; + u_pos_vert_agl_status_flag.base = 0; + u_pos_vert_agl_status_flag.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->pos_vert_agl_status_flag = u_pos_vert_agl_status_flag.real; + offset += sizeof(this->pos_vert_agl_status_flag); + union { + bool real; + uint8_t base; + } u_const_pos_mode_status_flag; + u_const_pos_mode_status_flag.base = 0; + u_const_pos_mode_status_flag.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->const_pos_mode_status_flag = u_const_pos_mode_status_flag.real; + offset += sizeof(this->const_pos_mode_status_flag); + union { + bool real; + uint8_t base; + } u_pred_pos_horiz_rel_status_flag; + u_pred_pos_horiz_rel_status_flag.base = 0; + u_pred_pos_horiz_rel_status_flag.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->pred_pos_horiz_rel_status_flag = u_pred_pos_horiz_rel_status_flag.real; + offset += sizeof(this->pred_pos_horiz_rel_status_flag); + union { + bool real; + uint8_t base; + } u_pred_pos_horiz_abs_status_flag; + u_pred_pos_horiz_abs_status_flag.base = 0; + u_pred_pos_horiz_abs_status_flag.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->pred_pos_horiz_abs_status_flag = u_pred_pos_horiz_abs_status_flag.real; + offset += sizeof(this->pred_pos_horiz_abs_status_flag); + union { + bool real; + uint8_t base; + } u_gps_glitch_status_flag; + u_gps_glitch_status_flag.base = 0; + u_gps_glitch_status_flag.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->gps_glitch_status_flag = u_gps_glitch_status_flag.real; + offset += sizeof(this->gps_glitch_status_flag); + union { + bool real; + uint8_t base; + } u_accel_error_status_flag; + u_accel_error_status_flag.base = 0; + u_accel_error_status_flag.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->accel_error_status_flag = u_accel_error_status_flag.real; + offset += sizeof(this->accel_error_status_flag); + return offset; + } + + virtual const char * getType() override { return "mavros_msgs/EstimatorStatus"; }; + virtual const char * getMD5() override { return "39dbcc4be3f04b68422f784827c47dd5"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/ExtendedState.h b/pio_workspace/lib/ros_lib/mavros_msgs/ExtendedState.h new file mode 100644 index 0000000..4d9e02b --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/ExtendedState.h @@ -0,0 +1,68 @@ +#ifndef _ROS_mavros_msgs_ExtendedState_h +#define _ROS_mavros_msgs_ExtendedState_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace mavros_msgs +{ + + class ExtendedState : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef uint8_t _vtol_state_type; + _vtol_state_type vtol_state; + typedef uint8_t _landed_state_type; + _landed_state_type landed_state; + enum { VTOL_STATE_UNDEFINED = 0 }; + enum { VTOL_STATE_TRANSITION_TO_FW = 1 }; + enum { VTOL_STATE_TRANSITION_TO_MC = 2 }; + enum { VTOL_STATE_MC = 3 }; + enum { VTOL_STATE_FW = 4 }; + enum { LANDED_STATE_UNDEFINED = 0 }; + enum { LANDED_STATE_ON_GROUND = 1 }; + enum { LANDED_STATE_IN_AIR = 2 }; + enum { LANDED_STATE_TAKEOFF = 3 }; + enum { LANDED_STATE_LANDING = 4 }; + + ExtendedState(): + header(), + vtol_state(0), + landed_state(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->vtol_state >> (8 * 0)) & 0xFF; + offset += sizeof(this->vtol_state); + *(outbuffer + offset + 0) = (this->landed_state >> (8 * 0)) & 0xFF; + offset += sizeof(this->landed_state); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + this->vtol_state = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->vtol_state); + this->landed_state = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->landed_state); + return offset; + } + + virtual const char * getType() override { return "mavros_msgs/ExtendedState"; }; + virtual const char * getMD5() override { return "ae780b1800fe17b917369d21b90058bd"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/FileChecksum.h b/pio_workspace/lib/ros_lib/mavros_msgs/FileChecksum.h new file mode 100644 index 0000000..5139629 --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/FileChecksum.h @@ -0,0 +1,142 @@ +#ifndef _ROS_SERVICE_FileChecksum_h +#define _ROS_SERVICE_FileChecksum_h +#include +#include +#include +#include "ros/msg.h" + +namespace mavros_msgs +{ + +static const char FILECHECKSUM[] = "mavros_msgs/FileChecksum"; + + class FileChecksumRequest : public ros::Msg + { + public: + typedef const char* _file_path_type; + _file_path_type file_path; + + FileChecksumRequest(): + file_path("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_file_path = strlen(this->file_path); + varToArr(outbuffer + offset, length_file_path); + offset += 4; + memcpy(outbuffer + offset, this->file_path, length_file_path); + offset += length_file_path; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_file_path; + arrToVar(length_file_path, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_file_path; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_file_path-1]=0; + this->file_path = (char *)(inbuffer + offset-1); + offset += length_file_path; + return offset; + } + + virtual const char * getType() override { return FILECHECKSUM; }; + virtual const char * getMD5() override { return "a1f82596372c52a517e1fe32d1e998e8"; }; + + }; + + class FileChecksumResponse : public ros::Msg + { + public: + typedef uint32_t _crc32_type; + _crc32_type crc32; + typedef bool _success_type; + _success_type success; + typedef int32_t _r_errno_type; + _r_errno_type r_errno; + + FileChecksumResponse(): + crc32(0), + success(0), + r_errno(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->crc32 >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->crc32 >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->crc32 >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->crc32 >> (8 * 3)) & 0xFF; + offset += sizeof(this->crc32); + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + union { + int32_t real; + uint32_t base; + } u_r_errno; + u_r_errno.real = this->r_errno; + *(outbuffer + offset + 0) = (u_r_errno.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_r_errno.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_r_errno.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_r_errno.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->r_errno); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->crc32 = ((uint32_t) (*(inbuffer + offset))); + this->crc32 |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->crc32 |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->crc32 |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->crc32); + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + union { + int32_t real; + uint32_t base; + } u_r_errno; + u_r_errno.base = 0; + u_r_errno.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_r_errno.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_r_errno.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_r_errno.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->r_errno = u_r_errno.real; + offset += sizeof(this->r_errno); + return offset; + } + + virtual const char * getType() override { return FILECHECKSUM; }; + virtual const char * getMD5() override { return "8ecf737b97670b745ca39c7b185cc756"; }; + + }; + + class FileChecksum { + public: + typedef FileChecksumRequest Request; + typedef FileChecksumResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/FileClose.h b/pio_workspace/lib/ros_lib/mavros_msgs/FileClose.h new file mode 100644 index 0000000..a00fe18 --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/FileClose.h @@ -0,0 +1,129 @@ +#ifndef _ROS_SERVICE_FileClose_h +#define _ROS_SERVICE_FileClose_h +#include +#include +#include +#include "ros/msg.h" + +namespace mavros_msgs +{ + +static const char FILECLOSE[] = "mavros_msgs/FileClose"; + + class FileCloseRequest : public ros::Msg + { + public: + typedef const char* _file_path_type; + _file_path_type file_path; + + FileCloseRequest(): + file_path("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_file_path = strlen(this->file_path); + varToArr(outbuffer + offset, length_file_path); + offset += 4; + memcpy(outbuffer + offset, this->file_path, length_file_path); + offset += length_file_path; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_file_path; + arrToVar(length_file_path, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_file_path; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_file_path-1]=0; + this->file_path = (char *)(inbuffer + offset-1); + offset += length_file_path; + return offset; + } + + virtual const char * getType() override { return FILECLOSE; }; + virtual const char * getMD5() override { return "a1f82596372c52a517e1fe32d1e998e8"; }; + + }; + + class FileCloseResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + typedef int32_t _r_errno_type; + _r_errno_type r_errno; + + FileCloseResponse(): + success(0), + r_errno(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + union { + int32_t real; + uint32_t base; + } u_r_errno; + u_r_errno.real = this->r_errno; + *(outbuffer + offset + 0) = (u_r_errno.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_r_errno.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_r_errno.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_r_errno.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->r_errno); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + union { + int32_t real; + uint32_t base; + } u_r_errno; + u_r_errno.base = 0; + u_r_errno.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_r_errno.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_r_errno.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_r_errno.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->r_errno = u_r_errno.real; + offset += sizeof(this->r_errno); + return offset; + } + + virtual const char * getType() override { return FILECLOSE; }; + virtual const char * getMD5() override { return "85394f2e941a8937ac567a617f06157f"; }; + + }; + + class FileClose { + public: + typedef FileCloseRequest Request; + typedef FileCloseResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/FileEntry.h b/pio_workspace/lib/ros_lib/mavros_msgs/FileEntry.h new file mode 100644 index 0000000..b9909ed --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/FileEntry.h @@ -0,0 +1,85 @@ +#ifndef _ROS_mavros_msgs_FileEntry_h +#define _ROS_mavros_msgs_FileEntry_h + +#include +#include +#include +#include "ros/msg.h" + +namespace mavros_msgs +{ + + class FileEntry : public ros::Msg + { + public: + typedef const char* _name_type; + _name_type name; + typedef uint8_t _type_type; + _type_type type; + typedef uint64_t _size_type; + _size_type size; + enum { TYPE_FILE = 0 }; + enum { TYPE_DIRECTORY = 1 }; + + FileEntry(): + name(""), + type(0), + size(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_name = strlen(this->name); + varToArr(outbuffer + offset, length_name); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + *(outbuffer + offset + 0) = (this->type >> (8 * 0)) & 0xFF; + offset += sizeof(this->type); + *(outbuffer + offset + 0) = (this->size >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->size >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->size >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->size >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (this->size >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (this->size >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (this->size >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (this->size >> (8 * 7)) & 0xFF; + offset += sizeof(this->size); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_name; + arrToVar(length_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + this->type = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->type); + this->size = ((uint64_t) (*(inbuffer + offset))); + this->size |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->size |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->size |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->size |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + this->size |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + this->size |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + this->size |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + offset += sizeof(this->size); + return offset; + } + + virtual const char * getType() override { return "mavros_msgs/FileEntry"; }; + virtual const char * getMD5() override { return "5ed706bccb946c5b3a5087569cc53ac3"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/FileList.h b/pio_workspace/lib/ros_lib/mavros_msgs/FileList.h new file mode 100644 index 0000000..557b553 --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/FileList.h @@ -0,0 +1,155 @@ +#ifndef _ROS_SERVICE_FileList_h +#define _ROS_SERVICE_FileList_h +#include +#include +#include +#include "ros/msg.h" +#include "mavros_msgs/FileEntry.h" + +namespace mavros_msgs +{ + +static const char FILELIST[] = "mavros_msgs/FileList"; + + class FileListRequest : public ros::Msg + { + public: + typedef const char* _dir_path_type; + _dir_path_type dir_path; + + FileListRequest(): + dir_path("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_dir_path = strlen(this->dir_path); + varToArr(outbuffer + offset, length_dir_path); + offset += 4; + memcpy(outbuffer + offset, this->dir_path, length_dir_path); + offset += length_dir_path; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_dir_path; + arrToVar(length_dir_path, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_dir_path; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_dir_path-1]=0; + this->dir_path = (char *)(inbuffer + offset-1); + offset += length_dir_path; + return offset; + } + + virtual const char * getType() override { return FILELIST; }; + virtual const char * getMD5() override { return "401d5cf5f836aaa9ebdc0897f75da874"; }; + + }; + + class FileListResponse : public ros::Msg + { + public: + uint32_t list_length; + typedef mavros_msgs::FileEntry _list_type; + _list_type st_list; + _list_type * list; + typedef bool _success_type; + _success_type success; + typedef int32_t _r_errno_type; + _r_errno_type r_errno; + + FileListResponse(): + list_length(0), st_list(), list(nullptr), + success(0), + r_errno(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->list_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->list_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->list_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->list_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->list_length); + for( uint32_t i = 0; i < list_length; i++){ + offset += this->list[i].serialize(outbuffer + offset); + } + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + union { + int32_t real; + uint32_t base; + } u_r_errno; + u_r_errno.real = this->r_errno; + *(outbuffer + offset + 0) = (u_r_errno.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_r_errno.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_r_errno.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_r_errno.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->r_errno); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t list_lengthT = ((uint32_t) (*(inbuffer + offset))); + list_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + list_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + list_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->list_length); + if(list_lengthT > list_length) + this->list = (mavros_msgs::FileEntry*)realloc(this->list, list_lengthT * sizeof(mavros_msgs::FileEntry)); + list_length = list_lengthT; + for( uint32_t i = 0; i < list_length; i++){ + offset += this->st_list.deserialize(inbuffer + offset); + memcpy( &(this->list[i]), &(this->st_list), sizeof(mavros_msgs::FileEntry)); + } + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + union { + int32_t real; + uint32_t base; + } u_r_errno; + u_r_errno.base = 0; + u_r_errno.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_r_errno.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_r_errno.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_r_errno.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->r_errno = u_r_errno.real; + offset += sizeof(this->r_errno); + return offset; + } + + virtual const char * getType() override { return FILELIST; }; + virtual const char * getMD5() override { return "3cf4be333d40be8a08832e3b61ed4336"; }; + + }; + + class FileList { + public: + typedef FileListRequest Request; + typedef FileListResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/FileMakeDir.h b/pio_workspace/lib/ros_lib/mavros_msgs/FileMakeDir.h new file mode 100644 index 0000000..aae8b2f --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/FileMakeDir.h @@ -0,0 +1,129 @@ +#ifndef _ROS_SERVICE_FileMakeDir_h +#define _ROS_SERVICE_FileMakeDir_h +#include +#include +#include +#include "ros/msg.h" + +namespace mavros_msgs +{ + +static const char FILEMAKEDIR[] = "mavros_msgs/FileMakeDir"; + + class FileMakeDirRequest : public ros::Msg + { + public: + typedef const char* _dir_path_type; + _dir_path_type dir_path; + + FileMakeDirRequest(): + dir_path("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_dir_path = strlen(this->dir_path); + varToArr(outbuffer + offset, length_dir_path); + offset += 4; + memcpy(outbuffer + offset, this->dir_path, length_dir_path); + offset += length_dir_path; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_dir_path; + arrToVar(length_dir_path, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_dir_path; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_dir_path-1]=0; + this->dir_path = (char *)(inbuffer + offset-1); + offset += length_dir_path; + return offset; + } + + virtual const char * getType() override { return FILEMAKEDIR; }; + virtual const char * getMD5() override { return "401d5cf5f836aaa9ebdc0897f75da874"; }; + + }; + + class FileMakeDirResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + typedef int32_t _r_errno_type; + _r_errno_type r_errno; + + FileMakeDirResponse(): + success(0), + r_errno(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + union { + int32_t real; + uint32_t base; + } u_r_errno; + u_r_errno.real = this->r_errno; + *(outbuffer + offset + 0) = (u_r_errno.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_r_errno.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_r_errno.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_r_errno.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->r_errno); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + union { + int32_t real; + uint32_t base; + } u_r_errno; + u_r_errno.base = 0; + u_r_errno.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_r_errno.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_r_errno.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_r_errno.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->r_errno = u_r_errno.real; + offset += sizeof(this->r_errno); + return offset; + } + + virtual const char * getType() override { return FILEMAKEDIR; }; + virtual const char * getMD5() override { return "85394f2e941a8937ac567a617f06157f"; }; + + }; + + class FileMakeDir { + public: + typedef FileMakeDirRequest Request; + typedef FileMakeDirResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/FileOpen.h b/pio_workspace/lib/ros_lib/mavros_msgs/FileOpen.h new file mode 100644 index 0000000..e7c5fcb --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/FileOpen.h @@ -0,0 +1,152 @@ +#ifndef _ROS_SERVICE_FileOpen_h +#define _ROS_SERVICE_FileOpen_h +#include +#include +#include +#include "ros/msg.h" + +namespace mavros_msgs +{ + +static const char FILEOPEN[] = "mavros_msgs/FileOpen"; + + class FileOpenRequest : public ros::Msg + { + public: + typedef const char* _file_path_type; + _file_path_type file_path; + typedef uint8_t _mode_type; + _mode_type mode; + enum { MODE_READ = 0 }; + enum { MODE_WRITE = 1 }; + enum { MODE_CREATE = 2 }; + + FileOpenRequest(): + file_path(""), + mode(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_file_path = strlen(this->file_path); + varToArr(outbuffer + offset, length_file_path); + offset += 4; + memcpy(outbuffer + offset, this->file_path, length_file_path); + offset += length_file_path; + *(outbuffer + offset + 0) = (this->mode >> (8 * 0)) & 0xFF; + offset += sizeof(this->mode); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_file_path; + arrToVar(length_file_path, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_file_path; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_file_path-1]=0; + this->file_path = (char *)(inbuffer + offset-1); + offset += length_file_path; + this->mode = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->mode); + return offset; + } + + virtual const char * getType() override { return FILEOPEN; }; + virtual const char * getMD5() override { return "5d3365f008508e7b1c9862cdbc4459de"; }; + + }; + + class FileOpenResponse : public ros::Msg + { + public: + typedef uint32_t _size_type; + _size_type size; + typedef bool _success_type; + _success_type success; + typedef int32_t _r_errno_type; + _r_errno_type r_errno; + + FileOpenResponse(): + size(0), + success(0), + r_errno(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->size >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->size >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->size >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->size >> (8 * 3)) & 0xFF; + offset += sizeof(this->size); + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + union { + int32_t real; + uint32_t base; + } u_r_errno; + u_r_errno.real = this->r_errno; + *(outbuffer + offset + 0) = (u_r_errno.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_r_errno.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_r_errno.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_r_errno.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->r_errno); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->size = ((uint32_t) (*(inbuffer + offset))); + this->size |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->size |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->size |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->size); + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + union { + int32_t real; + uint32_t base; + } u_r_errno; + u_r_errno.base = 0; + u_r_errno.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_r_errno.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_r_errno.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_r_errno.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->r_errno = u_r_errno.real; + offset += sizeof(this->r_errno); + return offset; + } + + virtual const char * getType() override { return FILEOPEN; }; + virtual const char * getMD5() override { return "0ff9b1d5b96094ef5adccef61431a04f"; }; + + }; + + class FileOpen { + public: + typedef FileOpenRequest Request; + typedef FileOpenResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/FileRead.h b/pio_workspace/lib/ros_lib/mavros_msgs/FileRead.h new file mode 100644 index 0000000..469d1cd --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/FileRead.h @@ -0,0 +1,198 @@ +#ifndef _ROS_SERVICE_FileRead_h +#define _ROS_SERVICE_FileRead_h +#include +#include +#include +#include "ros/msg.h" + +namespace mavros_msgs +{ + +static const char FILEREAD[] = "mavros_msgs/FileRead"; + + class FileReadRequest : public ros::Msg + { + public: + typedef const char* _file_path_type; + _file_path_type file_path; + typedef uint64_t _offset_type; + _offset_type offset; + typedef uint64_t _size_type; + _size_type size; + + FileReadRequest(): + file_path(""), + offset(0), + size(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_file_path = strlen(this->file_path); + varToArr(outbuffer + offset, length_file_path); + offset += 4; + memcpy(outbuffer + offset, this->file_path, length_file_path); + offset += length_file_path; + *(outbuffer + offset + 0) = (this->offset >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->offset >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->offset >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->offset >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (this->offset >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (this->offset >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (this->offset >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (this->offset >> (8 * 7)) & 0xFF; + offset += sizeof(this->offset); + *(outbuffer + offset + 0) = (this->size >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->size >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->size >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->size >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (this->size >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (this->size >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (this->size >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (this->size >> (8 * 7)) & 0xFF; + offset += sizeof(this->size); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_file_path; + arrToVar(length_file_path, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_file_path; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_file_path-1]=0; + this->file_path = (char *)(inbuffer + offset-1); + offset += length_file_path; + this->offset = ((uint64_t) (*(inbuffer + offset))); + this->offset |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->offset |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->offset |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->offset |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + this->offset |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + this->offset |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + this->offset |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + offset += sizeof(this->offset); + this->size = ((uint64_t) (*(inbuffer + offset))); + this->size |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->size |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->size |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->size |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + this->size |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + this->size |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + this->size |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + offset += sizeof(this->size); + return offset; + } + + virtual const char * getType() override { return FILEREAD; }; + virtual const char * getMD5() override { return "c83da8c18af06c9d7d1b66667fa2bb6b"; }; + + }; + + class FileReadResponse : public ros::Msg + { + public: + uint32_t data_length; + typedef uint8_t _data_type; + _data_type st_data; + _data_type * data; + typedef bool _success_type; + _success_type success; + typedef int32_t _r_errno_type; + _r_errno_type r_errno; + + FileReadResponse(): + data_length(0), st_data(), data(nullptr), + success(0), + r_errno(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->data_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->data_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->data_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->data_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->data_length); + for( uint32_t i = 0; i < data_length; i++){ + *(outbuffer + offset + 0) = (this->data[i] >> (8 * 0)) & 0xFF; + offset += sizeof(this->data[i]); + } + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + union { + int32_t real; + uint32_t base; + } u_r_errno; + u_r_errno.real = this->r_errno; + *(outbuffer + offset + 0) = (u_r_errno.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_r_errno.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_r_errno.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_r_errno.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->r_errno); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t data_lengthT = ((uint32_t) (*(inbuffer + offset))); + data_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + data_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + data_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->data_length); + if(data_lengthT > data_length) + this->data = (uint8_t*)realloc(this->data, data_lengthT * sizeof(uint8_t)); + data_length = data_lengthT; + for( uint32_t i = 0; i < data_length; i++){ + this->st_data = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(uint8_t)); + } + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + union { + int32_t real; + uint32_t base; + } u_r_errno; + u_r_errno.base = 0; + u_r_errno.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_r_errno.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_r_errno.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_r_errno.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->r_errno = u_r_errno.real; + offset += sizeof(this->r_errno); + return offset; + } + + virtual const char * getType() override { return FILEREAD; }; + virtual const char * getMD5() override { return "729aa1e22d45390356095d59a2993cb4"; }; + + }; + + class FileRead { + public: + typedef FileReadRequest Request; + typedef FileReadResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/FileRemove.h b/pio_workspace/lib/ros_lib/mavros_msgs/FileRemove.h new file mode 100644 index 0000000..07a38c8 --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/FileRemove.h @@ -0,0 +1,129 @@ +#ifndef _ROS_SERVICE_FileRemove_h +#define _ROS_SERVICE_FileRemove_h +#include +#include +#include +#include "ros/msg.h" + +namespace mavros_msgs +{ + +static const char FILEREMOVE[] = "mavros_msgs/FileRemove"; + + class FileRemoveRequest : public ros::Msg + { + public: + typedef const char* _file_path_type; + _file_path_type file_path; + + FileRemoveRequest(): + file_path("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_file_path = strlen(this->file_path); + varToArr(outbuffer + offset, length_file_path); + offset += 4; + memcpy(outbuffer + offset, this->file_path, length_file_path); + offset += length_file_path; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_file_path; + arrToVar(length_file_path, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_file_path; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_file_path-1]=0; + this->file_path = (char *)(inbuffer + offset-1); + offset += length_file_path; + return offset; + } + + virtual const char * getType() override { return FILEREMOVE; }; + virtual const char * getMD5() override { return "a1f82596372c52a517e1fe32d1e998e8"; }; + + }; + + class FileRemoveResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + typedef int32_t _r_errno_type; + _r_errno_type r_errno; + + FileRemoveResponse(): + success(0), + r_errno(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + union { + int32_t real; + uint32_t base; + } u_r_errno; + u_r_errno.real = this->r_errno; + *(outbuffer + offset + 0) = (u_r_errno.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_r_errno.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_r_errno.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_r_errno.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->r_errno); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + union { + int32_t real; + uint32_t base; + } u_r_errno; + u_r_errno.base = 0; + u_r_errno.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_r_errno.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_r_errno.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_r_errno.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->r_errno = u_r_errno.real; + offset += sizeof(this->r_errno); + return offset; + } + + virtual const char * getType() override { return FILEREMOVE; }; + virtual const char * getMD5() override { return "85394f2e941a8937ac567a617f06157f"; }; + + }; + + class FileRemove { + public: + typedef FileRemoveRequest Request; + typedef FileRemoveResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/FileRemoveDir.h b/pio_workspace/lib/ros_lib/mavros_msgs/FileRemoveDir.h new file mode 100644 index 0000000..17a6907 --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/FileRemoveDir.h @@ -0,0 +1,129 @@ +#ifndef _ROS_SERVICE_FileRemoveDir_h +#define _ROS_SERVICE_FileRemoveDir_h +#include +#include +#include +#include "ros/msg.h" + +namespace mavros_msgs +{ + +static const char FILEREMOVEDIR[] = "mavros_msgs/FileRemoveDir"; + + class FileRemoveDirRequest : public ros::Msg + { + public: + typedef const char* _dir_path_type; + _dir_path_type dir_path; + + FileRemoveDirRequest(): + dir_path("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_dir_path = strlen(this->dir_path); + varToArr(outbuffer + offset, length_dir_path); + offset += 4; + memcpy(outbuffer + offset, this->dir_path, length_dir_path); + offset += length_dir_path; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_dir_path; + arrToVar(length_dir_path, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_dir_path; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_dir_path-1]=0; + this->dir_path = (char *)(inbuffer + offset-1); + offset += length_dir_path; + return offset; + } + + virtual const char * getType() override { return FILEREMOVEDIR; }; + virtual const char * getMD5() override { return "401d5cf5f836aaa9ebdc0897f75da874"; }; + + }; + + class FileRemoveDirResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + typedef int32_t _r_errno_type; + _r_errno_type r_errno; + + FileRemoveDirResponse(): + success(0), + r_errno(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + union { + int32_t real; + uint32_t base; + } u_r_errno; + u_r_errno.real = this->r_errno; + *(outbuffer + offset + 0) = (u_r_errno.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_r_errno.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_r_errno.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_r_errno.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->r_errno); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + union { + int32_t real; + uint32_t base; + } u_r_errno; + u_r_errno.base = 0; + u_r_errno.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_r_errno.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_r_errno.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_r_errno.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->r_errno = u_r_errno.real; + offset += sizeof(this->r_errno); + return offset; + } + + virtual const char * getType() override { return FILEREMOVEDIR; }; + virtual const char * getMD5() override { return "85394f2e941a8937ac567a617f06157f"; }; + + }; + + class FileRemoveDir { + public: + typedef FileRemoveDirRequest Request; + typedef FileRemoveDirResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/FileRename.h b/pio_workspace/lib/ros_lib/mavros_msgs/FileRename.h new file mode 100644 index 0000000..6538f8b --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/FileRename.h @@ -0,0 +1,146 @@ +#ifndef _ROS_SERVICE_FileRename_h +#define _ROS_SERVICE_FileRename_h +#include +#include +#include +#include "ros/msg.h" + +namespace mavros_msgs +{ + +static const char FILERENAME[] = "mavros_msgs/FileRename"; + + class FileRenameRequest : public ros::Msg + { + public: + typedef const char* _old_path_type; + _old_path_type old_path; + typedef const char* _new_path_type; + _new_path_type new_path; + + FileRenameRequest(): + old_path(""), + new_path("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_old_path = strlen(this->old_path); + varToArr(outbuffer + offset, length_old_path); + offset += 4; + memcpy(outbuffer + offset, this->old_path, length_old_path); + offset += length_old_path; + uint32_t length_new_path = strlen(this->new_path); + varToArr(outbuffer + offset, length_new_path); + offset += 4; + memcpy(outbuffer + offset, this->new_path, length_new_path); + offset += length_new_path; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_old_path; + arrToVar(length_old_path, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_old_path; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_old_path-1]=0; + this->old_path = (char *)(inbuffer + offset-1); + offset += length_old_path; + uint32_t length_new_path; + arrToVar(length_new_path, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_new_path; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_new_path-1]=0; + this->new_path = (char *)(inbuffer + offset-1); + offset += length_new_path; + return offset; + } + + virtual const char * getType() override { return FILERENAME; }; + virtual const char * getMD5() override { return "e4a29684c4f7a3290a1bec0a9de2ed01"; }; + + }; + + class FileRenameResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + typedef int32_t _r_errno_type; + _r_errno_type r_errno; + + FileRenameResponse(): + success(0), + r_errno(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + union { + int32_t real; + uint32_t base; + } u_r_errno; + u_r_errno.real = this->r_errno; + *(outbuffer + offset + 0) = (u_r_errno.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_r_errno.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_r_errno.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_r_errno.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->r_errno); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + union { + int32_t real; + uint32_t base; + } u_r_errno; + u_r_errno.base = 0; + u_r_errno.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_r_errno.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_r_errno.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_r_errno.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->r_errno = u_r_errno.real; + offset += sizeof(this->r_errno); + return offset; + } + + virtual const char * getType() override { return FILERENAME; }; + virtual const char * getMD5() override { return "85394f2e941a8937ac567a617f06157f"; }; + + }; + + class FileRename { + public: + typedef FileRenameRequest Request; + typedef FileRenameResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/FileTruncate.h b/pio_workspace/lib/ros_lib/mavros_msgs/FileTruncate.h new file mode 100644 index 0000000..b7e4299 --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/FileTruncate.h @@ -0,0 +1,150 @@ +#ifndef _ROS_SERVICE_FileTruncate_h +#define _ROS_SERVICE_FileTruncate_h +#include +#include +#include +#include "ros/msg.h" + +namespace mavros_msgs +{ + +static const char FILETRUNCATE[] = "mavros_msgs/FileTruncate"; + + class FileTruncateRequest : public ros::Msg + { + public: + typedef const char* _file_path_type; + _file_path_type file_path; + typedef uint64_t _length_type; + _length_type length; + + FileTruncateRequest(): + file_path(""), + length(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_file_path = strlen(this->file_path); + varToArr(outbuffer + offset, length_file_path); + offset += 4; + memcpy(outbuffer + offset, this->file_path, length_file_path); + offset += length_file_path; + *(outbuffer + offset + 0) = (this->length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->length >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (this->length >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (this->length >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (this->length >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (this->length >> (8 * 7)) & 0xFF; + offset += sizeof(this->length); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_file_path; + arrToVar(length_file_path, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_file_path; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_file_path-1]=0; + this->file_path = (char *)(inbuffer + offset-1); + offset += length_file_path; + this->length = ((uint64_t) (*(inbuffer + offset))); + this->length |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->length |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->length |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->length |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + this->length |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + this->length |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + this->length |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + offset += sizeof(this->length); + return offset; + } + + virtual const char * getType() override { return FILETRUNCATE; }; + virtual const char * getMD5() override { return "8153dbfb1601dd12c2e69aba3171d186"; }; + + }; + + class FileTruncateResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + typedef int32_t _r_errno_type; + _r_errno_type r_errno; + + FileTruncateResponse(): + success(0), + r_errno(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + union { + int32_t real; + uint32_t base; + } u_r_errno; + u_r_errno.real = this->r_errno; + *(outbuffer + offset + 0) = (u_r_errno.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_r_errno.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_r_errno.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_r_errno.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->r_errno); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + union { + int32_t real; + uint32_t base; + } u_r_errno; + u_r_errno.base = 0; + u_r_errno.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_r_errno.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_r_errno.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_r_errno.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->r_errno = u_r_errno.real; + offset += sizeof(this->r_errno); + return offset; + } + + virtual const char * getType() override { return FILETRUNCATE; }; + virtual const char * getMD5() override { return "85394f2e941a8937ac567a617f06157f"; }; + + }; + + class FileTruncate { + public: + typedef FileTruncateRequest Request; + typedef FileTruncateResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/FileWrite.h b/pio_workspace/lib/ros_lib/mavros_msgs/FileWrite.h new file mode 100644 index 0000000..03e9366 --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/FileWrite.h @@ -0,0 +1,177 @@ +#ifndef _ROS_SERVICE_FileWrite_h +#define _ROS_SERVICE_FileWrite_h +#include +#include +#include +#include "ros/msg.h" + +namespace mavros_msgs +{ + +static const char FILEWRITE[] = "mavros_msgs/FileWrite"; + + class FileWriteRequest : public ros::Msg + { + public: + typedef const char* _file_path_type; + _file_path_type file_path; + typedef uint64_t _offset_type; + _offset_type offset; + uint32_t data_length; + typedef uint8_t _data_type; + _data_type st_data; + _data_type * data; + + FileWriteRequest(): + file_path(""), + offset(0), + data_length(0), st_data(), data(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_file_path = strlen(this->file_path); + varToArr(outbuffer + offset, length_file_path); + offset += 4; + memcpy(outbuffer + offset, this->file_path, length_file_path); + offset += length_file_path; + *(outbuffer + offset + 0) = (this->offset >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->offset >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->offset >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->offset >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (this->offset >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (this->offset >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (this->offset >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (this->offset >> (8 * 7)) & 0xFF; + offset += sizeof(this->offset); + *(outbuffer + offset + 0) = (this->data_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->data_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->data_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->data_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->data_length); + for( uint32_t i = 0; i < data_length; i++){ + *(outbuffer + offset + 0) = (this->data[i] >> (8 * 0)) & 0xFF; + offset += sizeof(this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_file_path; + arrToVar(length_file_path, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_file_path; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_file_path-1]=0; + this->file_path = (char *)(inbuffer + offset-1); + offset += length_file_path; + this->offset = ((uint64_t) (*(inbuffer + offset))); + this->offset |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->offset |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->offset |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->offset |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + this->offset |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + this->offset |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + this->offset |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + offset += sizeof(this->offset); + uint32_t data_lengthT = ((uint32_t) (*(inbuffer + offset))); + data_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + data_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + data_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->data_length); + if(data_lengthT > data_length) + this->data = (uint8_t*)realloc(this->data, data_lengthT * sizeof(uint8_t)); + data_length = data_lengthT; + for( uint32_t i = 0; i < data_length; i++){ + this->st_data = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(uint8_t)); + } + return offset; + } + + virtual const char * getType() override { return FILEWRITE; }; + virtual const char * getMD5() override { return "cf1a270aa1398f3f1fac1649fe2275ef"; }; + + }; + + class FileWriteResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + typedef int32_t _r_errno_type; + _r_errno_type r_errno; + + FileWriteResponse(): + success(0), + r_errno(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + union { + int32_t real; + uint32_t base; + } u_r_errno; + u_r_errno.real = this->r_errno; + *(outbuffer + offset + 0) = (u_r_errno.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_r_errno.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_r_errno.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_r_errno.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->r_errno); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + union { + int32_t real; + uint32_t base; + } u_r_errno; + u_r_errno.base = 0; + u_r_errno.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_r_errno.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_r_errno.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_r_errno.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->r_errno = u_r_errno.real; + offset += sizeof(this->r_errno); + return offset; + } + + virtual const char * getType() override { return FILEWRITE; }; + virtual const char * getMD5() override { return "85394f2e941a8937ac567a617f06157f"; }; + + }; + + class FileWrite { + public: + typedef FileWriteRequest Request; + typedef FileWriteResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/GPSINPUT.h b/pio_workspace/lib/ros_lib/mavros_msgs/GPSINPUT.h new file mode 100644 index 0000000..d0d4b58 --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/GPSINPUT.h @@ -0,0 +1,378 @@ +#ifndef _ROS_mavros_msgs_GPSINPUT_h +#define _ROS_mavros_msgs_GPSINPUT_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace mavros_msgs +{ + + class GPSINPUT : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef uint8_t _fix_type_type; + _fix_type_type fix_type; + typedef uint8_t _gps_id_type; + _gps_id_type gps_id; + typedef uint16_t _ignore_flags_type; + _ignore_flags_type ignore_flags; + typedef uint32_t _time_week_ms_type; + _time_week_ms_type time_week_ms; + typedef uint16_t _time_week_type; + _time_week_type time_week; + typedef int32_t _lat_type; + _lat_type lat; + typedef int32_t _lon_type; + _lon_type lon; + typedef float _alt_type; + _alt_type alt; + typedef float _hdop_type; + _hdop_type hdop; + typedef float _vdop_type; + _vdop_type vdop; + typedef float _vn_type; + _vn_type vn; + typedef float _ve_type; + _ve_type ve; + typedef float _vd_type; + _vd_type vd; + typedef float _speed_accuracy_type; + _speed_accuracy_type speed_accuracy; + typedef float _horiz_accuracy_type; + _horiz_accuracy_type horiz_accuracy; + typedef float _vert_accuracy_type; + _vert_accuracy_type vert_accuracy; + typedef uint8_t _satellites_visible_type; + _satellites_visible_type satellites_visible; + typedef uint16_t _yaw_type; + _yaw_type yaw; + enum { GPS_FIX_TYPE_NO_GPS = 0 }; + enum { GPS_FIX_TYPE_NO_FIX = 1 }; + enum { GPS_FIX_TYPE_2D_FIX = 2 }; + enum { GPS_FIX_TYPE_3D_FIX = 3 }; + enum { GPS_FIX_TYPE_DGPS = 4 }; + enum { GPS_FIX_TYPE_RTK_FLOATR = 5 }; + enum { GPS_FIX_TYPE_RTK_FIXEDR = 6 }; + enum { GPS_FIX_TYPE_STATIC = 7 }; + enum { GPS_FIX_TYPE_PPP = 8 }; + + GPSINPUT(): + header(), + fix_type(0), + gps_id(0), + ignore_flags(0), + time_week_ms(0), + time_week(0), + lat(0), + lon(0), + alt(0), + hdop(0), + vdop(0), + vn(0), + ve(0), + vd(0), + speed_accuracy(0), + horiz_accuracy(0), + vert_accuracy(0), + satellites_visible(0), + yaw(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->fix_type >> (8 * 0)) & 0xFF; + offset += sizeof(this->fix_type); + *(outbuffer + offset + 0) = (this->gps_id >> (8 * 0)) & 0xFF; + offset += sizeof(this->gps_id); + *(outbuffer + offset + 0) = (this->ignore_flags >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->ignore_flags >> (8 * 1)) & 0xFF; + offset += sizeof(this->ignore_flags); + *(outbuffer + offset + 0) = (this->time_week_ms >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->time_week_ms >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->time_week_ms >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->time_week_ms >> (8 * 3)) & 0xFF; + offset += sizeof(this->time_week_ms); + *(outbuffer + offset + 0) = (this->time_week >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->time_week >> (8 * 1)) & 0xFF; + offset += sizeof(this->time_week); + union { + int32_t real; + uint32_t base; + } u_lat; + u_lat.real = this->lat; + *(outbuffer + offset + 0) = (u_lat.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_lat.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_lat.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_lat.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->lat); + union { + int32_t real; + uint32_t base; + } u_lon; + u_lon.real = this->lon; + *(outbuffer + offset + 0) = (u_lon.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_lon.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_lon.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_lon.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->lon); + union { + float real; + uint32_t base; + } u_alt; + u_alt.real = this->alt; + *(outbuffer + offset + 0) = (u_alt.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_alt.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_alt.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_alt.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->alt); + union { + float real; + uint32_t base; + } u_hdop; + u_hdop.real = this->hdop; + *(outbuffer + offset + 0) = (u_hdop.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_hdop.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_hdop.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_hdop.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->hdop); + union { + float real; + uint32_t base; + } u_vdop; + u_vdop.real = this->vdop; + *(outbuffer + offset + 0) = (u_vdop.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_vdop.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_vdop.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_vdop.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->vdop); + union { + float real; + uint32_t base; + } u_vn; + u_vn.real = this->vn; + *(outbuffer + offset + 0) = (u_vn.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_vn.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_vn.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_vn.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->vn); + union { + float real; + uint32_t base; + } u_ve; + u_ve.real = this->ve; + *(outbuffer + offset + 0) = (u_ve.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_ve.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_ve.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_ve.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->ve); + union { + float real; + uint32_t base; + } u_vd; + u_vd.real = this->vd; + *(outbuffer + offset + 0) = (u_vd.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_vd.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_vd.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_vd.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->vd); + union { + float real; + uint32_t base; + } u_speed_accuracy; + u_speed_accuracy.real = this->speed_accuracy; + *(outbuffer + offset + 0) = (u_speed_accuracy.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_speed_accuracy.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_speed_accuracy.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_speed_accuracy.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->speed_accuracy); + union { + float real; + uint32_t base; + } u_horiz_accuracy; + u_horiz_accuracy.real = this->horiz_accuracy; + *(outbuffer + offset + 0) = (u_horiz_accuracy.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_horiz_accuracy.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_horiz_accuracy.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_horiz_accuracy.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->horiz_accuracy); + union { + float real; + uint32_t base; + } u_vert_accuracy; + u_vert_accuracy.real = this->vert_accuracy; + *(outbuffer + offset + 0) = (u_vert_accuracy.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_vert_accuracy.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_vert_accuracy.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_vert_accuracy.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->vert_accuracy); + *(outbuffer + offset + 0) = (this->satellites_visible >> (8 * 0)) & 0xFF; + offset += sizeof(this->satellites_visible); + *(outbuffer + offset + 0) = (this->yaw >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->yaw >> (8 * 1)) & 0xFF; + offset += sizeof(this->yaw); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + this->fix_type = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->fix_type); + this->gps_id = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->gps_id); + this->ignore_flags = ((uint16_t) (*(inbuffer + offset))); + this->ignore_flags |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->ignore_flags); + this->time_week_ms = ((uint32_t) (*(inbuffer + offset))); + this->time_week_ms |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->time_week_ms |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->time_week_ms |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->time_week_ms); + this->time_week = ((uint16_t) (*(inbuffer + offset))); + this->time_week |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->time_week); + union { + int32_t real; + uint32_t base; + } u_lat; + u_lat.base = 0; + u_lat.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_lat.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_lat.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_lat.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->lat = u_lat.real; + offset += sizeof(this->lat); + union { + int32_t real; + uint32_t base; + } u_lon; + u_lon.base = 0; + u_lon.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_lon.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_lon.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_lon.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->lon = u_lon.real; + offset += sizeof(this->lon); + union { + float real; + uint32_t base; + } u_alt; + u_alt.base = 0; + u_alt.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_alt.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_alt.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_alt.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->alt = u_alt.real; + offset += sizeof(this->alt); + union { + float real; + uint32_t base; + } u_hdop; + u_hdop.base = 0; + u_hdop.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_hdop.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_hdop.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_hdop.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->hdop = u_hdop.real; + offset += sizeof(this->hdop); + union { + float real; + uint32_t base; + } u_vdop; + u_vdop.base = 0; + u_vdop.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_vdop.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_vdop.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_vdop.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->vdop = u_vdop.real; + offset += sizeof(this->vdop); + union { + float real; + uint32_t base; + } u_vn; + u_vn.base = 0; + u_vn.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_vn.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_vn.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_vn.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->vn = u_vn.real; + offset += sizeof(this->vn); + union { + float real; + uint32_t base; + } u_ve; + u_ve.base = 0; + u_ve.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_ve.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_ve.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_ve.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->ve = u_ve.real; + offset += sizeof(this->ve); + union { + float real; + uint32_t base; + } u_vd; + u_vd.base = 0; + u_vd.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_vd.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_vd.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_vd.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->vd = u_vd.real; + offset += sizeof(this->vd); + union { + float real; + uint32_t base; + } u_speed_accuracy; + u_speed_accuracy.base = 0; + u_speed_accuracy.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_speed_accuracy.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_speed_accuracy.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_speed_accuracy.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->speed_accuracy = u_speed_accuracy.real; + offset += sizeof(this->speed_accuracy); + union { + float real; + uint32_t base; + } u_horiz_accuracy; + u_horiz_accuracy.base = 0; + u_horiz_accuracy.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_horiz_accuracy.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_horiz_accuracy.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_horiz_accuracy.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->horiz_accuracy = u_horiz_accuracy.real; + offset += sizeof(this->horiz_accuracy); + union { + float real; + uint32_t base; + } u_vert_accuracy; + u_vert_accuracy.base = 0; + u_vert_accuracy.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_vert_accuracy.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_vert_accuracy.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_vert_accuracy.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->vert_accuracy = u_vert_accuracy.real; + offset += sizeof(this->vert_accuracy); + this->satellites_visible = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->satellites_visible); + this->yaw = ((uint16_t) (*(inbuffer + offset))); + this->yaw |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->yaw); + return offset; + } + + virtual const char * getType() override { return "mavros_msgs/GPSINPUT"; }; + virtual const char * getMD5() override { return "928ef4ffec7b9af7c6e4748f0542b6a0"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/GPSRAW.h b/pio_workspace/lib/ros_lib/mavros_msgs/GPSRAW.h new file mode 100644 index 0000000..ba1d321 --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/GPSRAW.h @@ -0,0 +1,291 @@ +#ifndef _ROS_mavros_msgs_GPSRAW_h +#define _ROS_mavros_msgs_GPSRAW_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace mavros_msgs +{ + + class GPSRAW : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef uint8_t _fix_type_type; + _fix_type_type fix_type; + typedef int32_t _lat_type; + _lat_type lat; + typedef int32_t _lon_type; + _lon_type lon; + typedef int32_t _alt_type; + _alt_type alt; + typedef uint16_t _eph_type; + _eph_type eph; + typedef uint16_t _epv_type; + _epv_type epv; + typedef uint16_t _vel_type; + _vel_type vel; + typedef uint16_t _cog_type; + _cog_type cog; + typedef uint8_t _satellites_visible_type; + _satellites_visible_type satellites_visible; + typedef int32_t _alt_ellipsoid_type; + _alt_ellipsoid_type alt_ellipsoid; + typedef uint32_t _h_acc_type; + _h_acc_type h_acc; + typedef uint32_t _v_acc_type; + _v_acc_type v_acc; + typedef uint32_t _vel_acc_type; + _vel_acc_type vel_acc; + typedef int32_t _hdg_acc_type; + _hdg_acc_type hdg_acc; + typedef uint16_t _yaw_type; + _yaw_type yaw; + typedef uint8_t _dgps_numch_type; + _dgps_numch_type dgps_numch; + typedef uint32_t _dgps_age_type; + _dgps_age_type dgps_age; + enum { GPS_FIX_TYPE_NO_GPS = 0 }; + enum { GPS_FIX_TYPE_NO_FIX = 1 }; + enum { GPS_FIX_TYPE_2D_FIX = 2 }; + enum { GPS_FIX_TYPE_3D_FIX = 3 }; + enum { GPS_FIX_TYPE_DGPS = 4 }; + enum { GPS_FIX_TYPE_RTK_FLOATR = 5 }; + enum { GPS_FIX_TYPE_RTK_FIXEDR = 6 }; + enum { GPS_FIX_TYPE_STATIC = 7 }; + enum { GPS_FIX_TYPE_PPP = 8 }; + + GPSRAW(): + header(), + fix_type(0), + lat(0), + lon(0), + alt(0), + eph(0), + epv(0), + vel(0), + cog(0), + satellites_visible(0), + alt_ellipsoid(0), + h_acc(0), + v_acc(0), + vel_acc(0), + hdg_acc(0), + yaw(0), + dgps_numch(0), + dgps_age(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->fix_type >> (8 * 0)) & 0xFF; + offset += sizeof(this->fix_type); + union { + int32_t real; + uint32_t base; + } u_lat; + u_lat.real = this->lat; + *(outbuffer + offset + 0) = (u_lat.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_lat.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_lat.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_lat.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->lat); + union { + int32_t real; + uint32_t base; + } u_lon; + u_lon.real = this->lon; + *(outbuffer + offset + 0) = (u_lon.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_lon.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_lon.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_lon.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->lon); + union { + int32_t real; + uint32_t base; + } u_alt; + u_alt.real = this->alt; + *(outbuffer + offset + 0) = (u_alt.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_alt.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_alt.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_alt.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->alt); + *(outbuffer + offset + 0) = (this->eph >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->eph >> (8 * 1)) & 0xFF; + offset += sizeof(this->eph); + *(outbuffer + offset + 0) = (this->epv >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->epv >> (8 * 1)) & 0xFF; + offset += sizeof(this->epv); + *(outbuffer + offset + 0) = (this->vel >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->vel >> (8 * 1)) & 0xFF; + offset += sizeof(this->vel); + *(outbuffer + offset + 0) = (this->cog >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->cog >> (8 * 1)) & 0xFF; + offset += sizeof(this->cog); + *(outbuffer + offset + 0) = (this->satellites_visible >> (8 * 0)) & 0xFF; + offset += sizeof(this->satellites_visible); + union { + int32_t real; + uint32_t base; + } u_alt_ellipsoid; + u_alt_ellipsoid.real = this->alt_ellipsoid; + *(outbuffer + offset + 0) = (u_alt_ellipsoid.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_alt_ellipsoid.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_alt_ellipsoid.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_alt_ellipsoid.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->alt_ellipsoid); + *(outbuffer + offset + 0) = (this->h_acc >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->h_acc >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->h_acc >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->h_acc >> (8 * 3)) & 0xFF; + offset += sizeof(this->h_acc); + *(outbuffer + offset + 0) = (this->v_acc >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->v_acc >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->v_acc >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->v_acc >> (8 * 3)) & 0xFF; + offset += sizeof(this->v_acc); + *(outbuffer + offset + 0) = (this->vel_acc >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->vel_acc >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->vel_acc >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->vel_acc >> (8 * 3)) & 0xFF; + offset += sizeof(this->vel_acc); + union { + int32_t real; + uint32_t base; + } u_hdg_acc; + u_hdg_acc.real = this->hdg_acc; + *(outbuffer + offset + 0) = (u_hdg_acc.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_hdg_acc.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_hdg_acc.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_hdg_acc.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->hdg_acc); + *(outbuffer + offset + 0) = (this->yaw >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->yaw >> (8 * 1)) & 0xFF; + offset += sizeof(this->yaw); + *(outbuffer + offset + 0) = (this->dgps_numch >> (8 * 0)) & 0xFF; + offset += sizeof(this->dgps_numch); + *(outbuffer + offset + 0) = (this->dgps_age >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->dgps_age >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->dgps_age >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->dgps_age >> (8 * 3)) & 0xFF; + offset += sizeof(this->dgps_age); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + this->fix_type = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->fix_type); + union { + int32_t real; + uint32_t base; + } u_lat; + u_lat.base = 0; + u_lat.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_lat.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_lat.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_lat.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->lat = u_lat.real; + offset += sizeof(this->lat); + union { + int32_t real; + uint32_t base; + } u_lon; + u_lon.base = 0; + u_lon.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_lon.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_lon.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_lon.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->lon = u_lon.real; + offset += sizeof(this->lon); + union { + int32_t real; + uint32_t base; + } u_alt; + u_alt.base = 0; + u_alt.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_alt.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_alt.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_alt.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->alt = u_alt.real; + offset += sizeof(this->alt); + this->eph = ((uint16_t) (*(inbuffer + offset))); + this->eph |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->eph); + this->epv = ((uint16_t) (*(inbuffer + offset))); + this->epv |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->epv); + this->vel = ((uint16_t) (*(inbuffer + offset))); + this->vel |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->vel); + this->cog = ((uint16_t) (*(inbuffer + offset))); + this->cog |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->cog); + this->satellites_visible = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->satellites_visible); + union { + int32_t real; + uint32_t base; + } u_alt_ellipsoid; + u_alt_ellipsoid.base = 0; + u_alt_ellipsoid.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_alt_ellipsoid.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_alt_ellipsoid.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_alt_ellipsoid.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->alt_ellipsoid = u_alt_ellipsoid.real; + offset += sizeof(this->alt_ellipsoid); + this->h_acc = ((uint32_t) (*(inbuffer + offset))); + this->h_acc |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->h_acc |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->h_acc |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->h_acc); + this->v_acc = ((uint32_t) (*(inbuffer + offset))); + this->v_acc |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->v_acc |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->v_acc |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->v_acc); + this->vel_acc = ((uint32_t) (*(inbuffer + offset))); + this->vel_acc |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->vel_acc |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->vel_acc |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->vel_acc); + union { + int32_t real; + uint32_t base; + } u_hdg_acc; + u_hdg_acc.base = 0; + u_hdg_acc.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_hdg_acc.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_hdg_acc.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_hdg_acc.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->hdg_acc = u_hdg_acc.real; + offset += sizeof(this->hdg_acc); + this->yaw = ((uint16_t) (*(inbuffer + offset))); + this->yaw |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->yaw); + this->dgps_numch = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->dgps_numch); + this->dgps_age = ((uint32_t) (*(inbuffer + offset))); + this->dgps_age |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->dgps_age |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->dgps_age |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->dgps_age); + return offset; + } + + virtual const char * getType() override { return "mavros_msgs/GPSRAW"; }; + virtual const char * getMD5() override { return "58a85dbc1516a2d4302f256cca54bbbf"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/GPSRTK.h b/pio_workspace/lib/ros_lib/mavros_msgs/GPSRTK.h new file mode 100644 index 0000000..868f18a --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/GPSRTK.h @@ -0,0 +1,214 @@ +#ifndef _ROS_mavros_msgs_GPSRTK_h +#define _ROS_mavros_msgs_GPSRTK_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace mavros_msgs +{ + + class GPSRTK : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef uint8_t _rtk_receiver_id_type; + _rtk_receiver_id_type rtk_receiver_id; + typedef int16_t _wn_type; + _wn_type wn; + typedef uint32_t _tow_type; + _tow_type tow; + typedef uint8_t _rtk_health_type; + _rtk_health_type rtk_health; + typedef uint8_t _rtk_rate_type; + _rtk_rate_type rtk_rate; + typedef uint8_t _nsats_type; + _nsats_type nsats; + typedef int32_t _baseline_a_type; + _baseline_a_type baseline_a; + typedef int32_t _baseline_b_type; + _baseline_b_type baseline_b; + typedef int32_t _baseline_c_type; + _baseline_c_type baseline_c; + typedef uint32_t _accuracy_type; + _accuracy_type accuracy; + typedef int32_t _iar_num_hypotheses_type; + _iar_num_hypotheses_type iar_num_hypotheses; + + GPSRTK(): + header(), + rtk_receiver_id(0), + wn(0), + tow(0), + rtk_health(0), + rtk_rate(0), + nsats(0), + baseline_a(0), + baseline_b(0), + baseline_c(0), + accuracy(0), + iar_num_hypotheses(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->rtk_receiver_id >> (8 * 0)) & 0xFF; + offset += sizeof(this->rtk_receiver_id); + union { + int16_t real; + uint16_t base; + } u_wn; + u_wn.real = this->wn; + *(outbuffer + offset + 0) = (u_wn.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_wn.base >> (8 * 1)) & 0xFF; + offset += sizeof(this->wn); + *(outbuffer + offset + 0) = (this->tow >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->tow >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->tow >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->tow >> (8 * 3)) & 0xFF; + offset += sizeof(this->tow); + *(outbuffer + offset + 0) = (this->rtk_health >> (8 * 0)) & 0xFF; + offset += sizeof(this->rtk_health); + *(outbuffer + offset + 0) = (this->rtk_rate >> (8 * 0)) & 0xFF; + offset += sizeof(this->rtk_rate); + *(outbuffer + offset + 0) = (this->nsats >> (8 * 0)) & 0xFF; + offset += sizeof(this->nsats); + union { + int32_t real; + uint32_t base; + } u_baseline_a; + u_baseline_a.real = this->baseline_a; + *(outbuffer + offset + 0) = (u_baseline_a.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_baseline_a.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_baseline_a.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_baseline_a.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->baseline_a); + union { + int32_t real; + uint32_t base; + } u_baseline_b; + u_baseline_b.real = this->baseline_b; + *(outbuffer + offset + 0) = (u_baseline_b.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_baseline_b.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_baseline_b.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_baseline_b.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->baseline_b); + union { + int32_t real; + uint32_t base; + } u_baseline_c; + u_baseline_c.real = this->baseline_c; + *(outbuffer + offset + 0) = (u_baseline_c.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_baseline_c.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_baseline_c.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_baseline_c.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->baseline_c); + *(outbuffer + offset + 0) = (this->accuracy >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->accuracy >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->accuracy >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->accuracy >> (8 * 3)) & 0xFF; + offset += sizeof(this->accuracy); + union { + int32_t real; + uint32_t base; + } u_iar_num_hypotheses; + u_iar_num_hypotheses.real = this->iar_num_hypotheses; + *(outbuffer + offset + 0) = (u_iar_num_hypotheses.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_iar_num_hypotheses.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_iar_num_hypotheses.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_iar_num_hypotheses.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->iar_num_hypotheses); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + this->rtk_receiver_id = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->rtk_receiver_id); + union { + int16_t real; + uint16_t base; + } u_wn; + u_wn.base = 0; + u_wn.base |= ((uint16_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_wn.base |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->wn = u_wn.real; + offset += sizeof(this->wn); + this->tow = ((uint32_t) (*(inbuffer + offset))); + this->tow |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->tow |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->tow |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->tow); + this->rtk_health = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->rtk_health); + this->rtk_rate = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->rtk_rate); + this->nsats = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->nsats); + union { + int32_t real; + uint32_t base; + } u_baseline_a; + u_baseline_a.base = 0; + u_baseline_a.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_baseline_a.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_baseline_a.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_baseline_a.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->baseline_a = u_baseline_a.real; + offset += sizeof(this->baseline_a); + union { + int32_t real; + uint32_t base; + } u_baseline_b; + u_baseline_b.base = 0; + u_baseline_b.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_baseline_b.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_baseline_b.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_baseline_b.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->baseline_b = u_baseline_b.real; + offset += sizeof(this->baseline_b); + union { + int32_t real; + uint32_t base; + } u_baseline_c; + u_baseline_c.base = 0; + u_baseline_c.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_baseline_c.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_baseline_c.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_baseline_c.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->baseline_c = u_baseline_c.real; + offset += sizeof(this->baseline_c); + this->accuracy = ((uint32_t) (*(inbuffer + offset))); + this->accuracy |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->accuracy |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->accuracy |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->accuracy); + union { + int32_t real; + uint32_t base; + } u_iar_num_hypotheses; + u_iar_num_hypotheses.base = 0; + u_iar_num_hypotheses.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_iar_num_hypotheses.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_iar_num_hypotheses.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_iar_num_hypotheses.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->iar_num_hypotheses = u_iar_num_hypotheses.real; + offset += sizeof(this->iar_num_hypotheses); + return offset; + } + + virtual const char * getType() override { return "mavros_msgs/GPSRTK"; }; + virtual const char * getMD5() override { return "ab2651768aa6464b60b7bc8ae031e017"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/GlobalPositionTarget.h b/pio_workspace/lib/ros_lib/mavros_msgs/GlobalPositionTarget.h new file mode 100644 index 0000000..c1449c3 --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/GlobalPositionTarget.h @@ -0,0 +1,168 @@ +#ifndef _ROS_mavros_msgs_GlobalPositionTarget_h +#define _ROS_mavros_msgs_GlobalPositionTarget_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Vector3.h" + +namespace mavros_msgs +{ + + class GlobalPositionTarget : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef uint8_t _coordinate_frame_type; + _coordinate_frame_type coordinate_frame; + typedef uint16_t _type_mask_type; + _type_mask_type type_mask; + typedef float _latitude_type; + _latitude_type latitude; + typedef float _longitude_type; + _longitude_type longitude; + typedef float _altitude_type; + _altitude_type altitude; + typedef geometry_msgs::Vector3 _velocity_type; + _velocity_type velocity; + typedef geometry_msgs::Vector3 _acceleration_or_force_type; + _acceleration_or_force_type acceleration_or_force; + typedef float _yaw_type; + _yaw_type yaw; + typedef float _yaw_rate_type; + _yaw_rate_type yaw_rate; + enum { FRAME_GLOBAL_INT = 5 }; + enum { FRAME_GLOBAL_REL_ALT = 6 }; + enum { FRAME_GLOBAL_TERRAIN_ALT = 11 }; + enum { IGNORE_LATITUDE = 1 }; + enum { IGNORE_LONGITUDE = 2 }; + enum { IGNORE_ALTITUDE = 4 }; + enum { IGNORE_VX = 8 }; + enum { IGNORE_VY = 16 }; + enum { IGNORE_VZ = 32 }; + enum { IGNORE_AFX = 64 }; + enum { IGNORE_AFY = 128 }; + enum { IGNORE_AFZ = 256 }; + enum { FORCE = 512 }; + enum { IGNORE_YAW = 1024 }; + enum { IGNORE_YAW_RATE = 2048 }; + + GlobalPositionTarget(): + header(), + coordinate_frame(0), + type_mask(0), + latitude(0), + longitude(0), + altitude(0), + velocity(), + acceleration_or_force(), + yaw(0), + yaw_rate(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->coordinate_frame >> (8 * 0)) & 0xFF; + offset += sizeof(this->coordinate_frame); + *(outbuffer + offset + 0) = (this->type_mask >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->type_mask >> (8 * 1)) & 0xFF; + offset += sizeof(this->type_mask); + offset += serializeAvrFloat64(outbuffer + offset, this->latitude); + offset += serializeAvrFloat64(outbuffer + offset, this->longitude); + union { + float real; + uint32_t base; + } u_altitude; + u_altitude.real = this->altitude; + *(outbuffer + offset + 0) = (u_altitude.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_altitude.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_altitude.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_altitude.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->altitude); + offset += this->velocity.serialize(outbuffer + offset); + offset += this->acceleration_or_force.serialize(outbuffer + offset); + union { + float real; + uint32_t base; + } u_yaw; + u_yaw.real = this->yaw; + *(outbuffer + offset + 0) = (u_yaw.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_yaw.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_yaw.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_yaw.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->yaw); + union { + float real; + uint32_t base; + } u_yaw_rate; + u_yaw_rate.real = this->yaw_rate; + *(outbuffer + offset + 0) = (u_yaw_rate.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_yaw_rate.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_yaw_rate.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_yaw_rate.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->yaw_rate); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + this->coordinate_frame = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->coordinate_frame); + this->type_mask = ((uint16_t) (*(inbuffer + offset))); + this->type_mask |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->type_mask); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->latitude)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->longitude)); + union { + float real; + uint32_t base; + } u_altitude; + u_altitude.base = 0; + u_altitude.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_altitude.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_altitude.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_altitude.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->altitude = u_altitude.real; + offset += sizeof(this->altitude); + offset += this->velocity.deserialize(inbuffer + offset); + offset += this->acceleration_or_force.deserialize(inbuffer + offset); + union { + float real; + uint32_t base; + } u_yaw; + u_yaw.base = 0; + u_yaw.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_yaw.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_yaw.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_yaw.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->yaw = u_yaw.real; + offset += sizeof(this->yaw); + union { + float real; + uint32_t base; + } u_yaw_rate; + u_yaw_rate.base = 0; + u_yaw_rate.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_yaw_rate.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_yaw_rate.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_yaw_rate.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->yaw_rate = u_yaw_rate.real; + offset += sizeof(this->yaw_rate); + return offset; + } + + virtual const char * getType() override { return "mavros_msgs/GlobalPositionTarget"; }; + virtual const char * getMD5() override { return "076ded0190b9e045f9c55264659ef102"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/HilActuatorControls.h b/pio_workspace/lib/ros_lib/mavros_msgs/HilActuatorControls.h new file mode 100644 index 0000000..513d2e3 --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/HilActuatorControls.h @@ -0,0 +1,99 @@ +#ifndef _ROS_mavros_msgs_HilActuatorControls_h +#define _ROS_mavros_msgs_HilActuatorControls_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace mavros_msgs +{ + + class HilActuatorControls : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + float controls[16]; + typedef uint8_t _mode_type; + _mode_type mode; + typedef uint64_t _flags_type; + _flags_type flags; + + HilActuatorControls(): + header(), + controls(), + mode(0), + flags(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + for( uint32_t i = 0; i < 16; i++){ + union { + float real; + uint32_t base; + } u_controlsi; + u_controlsi.real = this->controls[i]; + *(outbuffer + offset + 0) = (u_controlsi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_controlsi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_controlsi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_controlsi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->controls[i]); + } + *(outbuffer + offset + 0) = (this->mode >> (8 * 0)) & 0xFF; + offset += sizeof(this->mode); + *(outbuffer + offset + 0) = (this->flags >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->flags >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->flags >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->flags >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (this->flags >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (this->flags >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (this->flags >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (this->flags >> (8 * 7)) & 0xFF; + offset += sizeof(this->flags); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + for( uint32_t i = 0; i < 16; i++){ + union { + float real; + uint32_t base; + } u_controlsi; + u_controlsi.base = 0; + u_controlsi.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_controlsi.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_controlsi.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_controlsi.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->controls[i] = u_controlsi.real; + offset += sizeof(this->controls[i]); + } + this->mode = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->mode); + this->flags = ((uint64_t) (*(inbuffer + offset))); + this->flags |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->flags |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->flags |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->flags |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + this->flags |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + this->flags |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + this->flags |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + offset += sizeof(this->flags); + return offset; + } + + virtual const char * getType() override { return "mavros_msgs/HilActuatorControls"; }; + virtual const char * getMD5() override { return "18482e8ef0330ac2fc9a0421be1d11c3"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/HilControls.h b/pio_workspace/lib/ros_lib/mavros_msgs/HilControls.h new file mode 100644 index 0000000..8768828 --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/HilControls.h @@ -0,0 +1,250 @@ +#ifndef _ROS_mavros_msgs_HilControls_h +#define _ROS_mavros_msgs_HilControls_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace mavros_msgs +{ + + class HilControls : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef float _roll_ailerons_type; + _roll_ailerons_type roll_ailerons; + typedef float _pitch_elevator_type; + _pitch_elevator_type pitch_elevator; + typedef float _yaw_rudder_type; + _yaw_rudder_type yaw_rudder; + typedef float _throttle_type; + _throttle_type throttle; + typedef float _aux1_type; + _aux1_type aux1; + typedef float _aux2_type; + _aux2_type aux2; + typedef float _aux3_type; + _aux3_type aux3; + typedef float _aux4_type; + _aux4_type aux4; + typedef uint8_t _mode_type; + _mode_type mode; + typedef uint8_t _nav_mode_type; + _nav_mode_type nav_mode; + + HilControls(): + header(), + roll_ailerons(0), + pitch_elevator(0), + yaw_rudder(0), + throttle(0), + aux1(0), + aux2(0), + aux3(0), + aux4(0), + mode(0), + nav_mode(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + union { + float real; + uint32_t base; + } u_roll_ailerons; + u_roll_ailerons.real = this->roll_ailerons; + *(outbuffer + offset + 0) = (u_roll_ailerons.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_roll_ailerons.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_roll_ailerons.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_roll_ailerons.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->roll_ailerons); + union { + float real; + uint32_t base; + } u_pitch_elevator; + u_pitch_elevator.real = this->pitch_elevator; + *(outbuffer + offset + 0) = (u_pitch_elevator.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_pitch_elevator.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_pitch_elevator.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_pitch_elevator.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->pitch_elevator); + union { + float real; + uint32_t base; + } u_yaw_rudder; + u_yaw_rudder.real = this->yaw_rudder; + *(outbuffer + offset + 0) = (u_yaw_rudder.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_yaw_rudder.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_yaw_rudder.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_yaw_rudder.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->yaw_rudder); + union { + float real; + uint32_t base; + } u_throttle; + u_throttle.real = this->throttle; + *(outbuffer + offset + 0) = (u_throttle.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_throttle.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_throttle.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_throttle.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->throttle); + union { + float real; + uint32_t base; + } u_aux1; + u_aux1.real = this->aux1; + *(outbuffer + offset + 0) = (u_aux1.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_aux1.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_aux1.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_aux1.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->aux1); + union { + float real; + uint32_t base; + } u_aux2; + u_aux2.real = this->aux2; + *(outbuffer + offset + 0) = (u_aux2.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_aux2.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_aux2.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_aux2.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->aux2); + union { + float real; + uint32_t base; + } u_aux3; + u_aux3.real = this->aux3; + *(outbuffer + offset + 0) = (u_aux3.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_aux3.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_aux3.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_aux3.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->aux3); + union { + float real; + uint32_t base; + } u_aux4; + u_aux4.real = this->aux4; + *(outbuffer + offset + 0) = (u_aux4.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_aux4.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_aux4.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_aux4.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->aux4); + *(outbuffer + offset + 0) = (this->mode >> (8 * 0)) & 0xFF; + offset += sizeof(this->mode); + *(outbuffer + offset + 0) = (this->nav_mode >> (8 * 0)) & 0xFF; + offset += sizeof(this->nav_mode); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + union { + float real; + uint32_t base; + } u_roll_ailerons; + u_roll_ailerons.base = 0; + u_roll_ailerons.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_roll_ailerons.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_roll_ailerons.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_roll_ailerons.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->roll_ailerons = u_roll_ailerons.real; + offset += sizeof(this->roll_ailerons); + union { + float real; + uint32_t base; + } u_pitch_elevator; + u_pitch_elevator.base = 0; + u_pitch_elevator.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_pitch_elevator.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_pitch_elevator.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_pitch_elevator.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->pitch_elevator = u_pitch_elevator.real; + offset += sizeof(this->pitch_elevator); + union { + float real; + uint32_t base; + } u_yaw_rudder; + u_yaw_rudder.base = 0; + u_yaw_rudder.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_yaw_rudder.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_yaw_rudder.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_yaw_rudder.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->yaw_rudder = u_yaw_rudder.real; + offset += sizeof(this->yaw_rudder); + union { + float real; + uint32_t base; + } u_throttle; + u_throttle.base = 0; + u_throttle.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_throttle.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_throttle.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_throttle.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->throttle = u_throttle.real; + offset += sizeof(this->throttle); + union { + float real; + uint32_t base; + } u_aux1; + u_aux1.base = 0; + u_aux1.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_aux1.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_aux1.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_aux1.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->aux1 = u_aux1.real; + offset += sizeof(this->aux1); + union { + float real; + uint32_t base; + } u_aux2; + u_aux2.base = 0; + u_aux2.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_aux2.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_aux2.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_aux2.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->aux2 = u_aux2.real; + offset += sizeof(this->aux2); + union { + float real; + uint32_t base; + } u_aux3; + u_aux3.base = 0; + u_aux3.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_aux3.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_aux3.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_aux3.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->aux3 = u_aux3.real; + offset += sizeof(this->aux3); + union { + float real; + uint32_t base; + } u_aux4; + u_aux4.base = 0; + u_aux4.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_aux4.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_aux4.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_aux4.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->aux4 = u_aux4.real; + offset += sizeof(this->aux4); + this->mode = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->mode); + this->nav_mode = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->nav_mode); + return offset; + } + + virtual const char * getType() override { return "mavros_msgs/HilControls"; }; + virtual const char * getMD5() override { return "698148349c3a2e5720afcae2d934acca"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/HilGPS.h b/pio_workspace/lib/ros_lib/mavros_msgs/HilGPS.h new file mode 100644 index 0000000..4937a62 --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/HilGPS.h @@ -0,0 +1,160 @@ +#ifndef _ROS_mavros_msgs_HilGPS_h +#define _ROS_mavros_msgs_HilGPS_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geographic_msgs/GeoPoint.h" + +namespace mavros_msgs +{ + + class HilGPS : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef uint8_t _fix_type_type; + _fix_type_type fix_type; + typedef geographic_msgs::GeoPoint _geo_type; + _geo_type geo; + typedef uint16_t _eph_type; + _eph_type eph; + typedef uint16_t _epv_type; + _epv_type epv; + typedef uint16_t _vel_type; + _vel_type vel; + typedef int16_t _vn_type; + _vn_type vn; + typedef int16_t _ve_type; + _ve_type ve; + typedef int16_t _vd_type; + _vd_type vd; + typedef uint16_t _cog_type; + _cog_type cog; + typedef uint8_t _satellites_visible_type; + _satellites_visible_type satellites_visible; + + HilGPS(): + header(), + fix_type(0), + geo(), + eph(0), + epv(0), + vel(0), + vn(0), + ve(0), + vd(0), + cog(0), + satellites_visible(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->fix_type >> (8 * 0)) & 0xFF; + offset += sizeof(this->fix_type); + offset += this->geo.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->eph >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->eph >> (8 * 1)) & 0xFF; + offset += sizeof(this->eph); + *(outbuffer + offset + 0) = (this->epv >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->epv >> (8 * 1)) & 0xFF; + offset += sizeof(this->epv); + *(outbuffer + offset + 0) = (this->vel >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->vel >> (8 * 1)) & 0xFF; + offset += sizeof(this->vel); + union { + int16_t real; + uint16_t base; + } u_vn; + u_vn.real = this->vn; + *(outbuffer + offset + 0) = (u_vn.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_vn.base >> (8 * 1)) & 0xFF; + offset += sizeof(this->vn); + union { + int16_t real; + uint16_t base; + } u_ve; + u_ve.real = this->ve; + *(outbuffer + offset + 0) = (u_ve.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_ve.base >> (8 * 1)) & 0xFF; + offset += sizeof(this->ve); + union { + int16_t real; + uint16_t base; + } u_vd; + u_vd.real = this->vd; + *(outbuffer + offset + 0) = (u_vd.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_vd.base >> (8 * 1)) & 0xFF; + offset += sizeof(this->vd); + *(outbuffer + offset + 0) = (this->cog >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->cog >> (8 * 1)) & 0xFF; + offset += sizeof(this->cog); + *(outbuffer + offset + 0) = (this->satellites_visible >> (8 * 0)) & 0xFF; + offset += sizeof(this->satellites_visible); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + this->fix_type = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->fix_type); + offset += this->geo.deserialize(inbuffer + offset); + this->eph = ((uint16_t) (*(inbuffer + offset))); + this->eph |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->eph); + this->epv = ((uint16_t) (*(inbuffer + offset))); + this->epv |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->epv); + this->vel = ((uint16_t) (*(inbuffer + offset))); + this->vel |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->vel); + union { + int16_t real; + uint16_t base; + } u_vn; + u_vn.base = 0; + u_vn.base |= ((uint16_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_vn.base |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->vn = u_vn.real; + offset += sizeof(this->vn); + union { + int16_t real; + uint16_t base; + } u_ve; + u_ve.base = 0; + u_ve.base |= ((uint16_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_ve.base |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->ve = u_ve.real; + offset += sizeof(this->ve); + union { + int16_t real; + uint16_t base; + } u_vd; + u_vd.base = 0; + u_vd.base |= ((uint16_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_vd.base |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->vd = u_vd.real; + offset += sizeof(this->vd); + this->cog = ((uint16_t) (*(inbuffer + offset))); + this->cog |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->cog); + this->satellites_visible = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->satellites_visible); + return offset; + } + + virtual const char * getType() override { return "mavros_msgs/HilGPS"; }; + virtual const char * getMD5() override { return "313b3baf2319db196fa18376a4900a7b"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/HilSensor.h b/pio_workspace/lib/ros_lib/mavros_msgs/HilSensor.h new file mode 100644 index 0000000..0bd62dd --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/HilSensor.h @@ -0,0 +1,169 @@ +#ifndef _ROS_mavros_msgs_HilSensor_h +#define _ROS_mavros_msgs_HilSensor_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Vector3.h" + +namespace mavros_msgs +{ + + class HilSensor : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef geometry_msgs::Vector3 _acc_type; + _acc_type acc; + typedef geometry_msgs::Vector3 _gyro_type; + _gyro_type gyro; + typedef geometry_msgs::Vector3 _mag_type; + _mag_type mag; + typedef float _abs_pressure_type; + _abs_pressure_type abs_pressure; + typedef float _diff_pressure_type; + _diff_pressure_type diff_pressure; + typedef float _pressure_alt_type; + _pressure_alt_type pressure_alt; + typedef float _temperature_type; + _temperature_type temperature; + typedef uint32_t _fields_updated_type; + _fields_updated_type fields_updated; + + HilSensor(): + header(), + acc(), + gyro(), + mag(), + abs_pressure(0), + diff_pressure(0), + pressure_alt(0), + temperature(0), + fields_updated(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->acc.serialize(outbuffer + offset); + offset += this->gyro.serialize(outbuffer + offset); + offset += this->mag.serialize(outbuffer + offset); + union { + float real; + uint32_t base; + } u_abs_pressure; + u_abs_pressure.real = this->abs_pressure; + *(outbuffer + offset + 0) = (u_abs_pressure.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_abs_pressure.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_abs_pressure.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_abs_pressure.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->abs_pressure); + union { + float real; + uint32_t base; + } u_diff_pressure; + u_diff_pressure.real = this->diff_pressure; + *(outbuffer + offset + 0) = (u_diff_pressure.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_diff_pressure.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_diff_pressure.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_diff_pressure.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->diff_pressure); + union { + float real; + uint32_t base; + } u_pressure_alt; + u_pressure_alt.real = this->pressure_alt; + *(outbuffer + offset + 0) = (u_pressure_alt.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_pressure_alt.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_pressure_alt.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_pressure_alt.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->pressure_alt); + union { + float real; + uint32_t base; + } u_temperature; + u_temperature.real = this->temperature; + *(outbuffer + offset + 0) = (u_temperature.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_temperature.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_temperature.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_temperature.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->temperature); + *(outbuffer + offset + 0) = (this->fields_updated >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->fields_updated >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->fields_updated >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->fields_updated >> (8 * 3)) & 0xFF; + offset += sizeof(this->fields_updated); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->acc.deserialize(inbuffer + offset); + offset += this->gyro.deserialize(inbuffer + offset); + offset += this->mag.deserialize(inbuffer + offset); + union { + float real; + uint32_t base; + } u_abs_pressure; + u_abs_pressure.base = 0; + u_abs_pressure.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_abs_pressure.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_abs_pressure.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_abs_pressure.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->abs_pressure = u_abs_pressure.real; + offset += sizeof(this->abs_pressure); + union { + float real; + uint32_t base; + } u_diff_pressure; + u_diff_pressure.base = 0; + u_diff_pressure.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_diff_pressure.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_diff_pressure.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_diff_pressure.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->diff_pressure = u_diff_pressure.real; + offset += sizeof(this->diff_pressure); + union { + float real; + uint32_t base; + } u_pressure_alt; + u_pressure_alt.base = 0; + u_pressure_alt.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_pressure_alt.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_pressure_alt.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_pressure_alt.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->pressure_alt = u_pressure_alt.real; + offset += sizeof(this->pressure_alt); + union { + float real; + uint32_t base; + } u_temperature; + u_temperature.base = 0; + u_temperature.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_temperature.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_temperature.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_temperature.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->temperature = u_temperature.real; + offset += sizeof(this->temperature); + this->fields_updated = ((uint32_t) (*(inbuffer + offset))); + this->fields_updated |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->fields_updated |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->fields_updated |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->fields_updated); + return offset; + } + + virtual const char * getType() override { return "mavros_msgs/HilSensor"; }; + virtual const char * getMD5() override { return "2a892891e5c40d6dd1066bf1f394b5dc"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/HilStateQuaternion.h b/pio_workspace/lib/ros_lib/mavros_msgs/HilStateQuaternion.h new file mode 100644 index 0000000..d6c80a9 --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/HilStateQuaternion.h @@ -0,0 +1,120 @@ +#ifndef _ROS_mavros_msgs_HilStateQuaternion_h +#define _ROS_mavros_msgs_HilStateQuaternion_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Quaternion.h" +#include "geometry_msgs/Vector3.h" +#include "geographic_msgs/GeoPoint.h" + +namespace mavros_msgs +{ + + class HilStateQuaternion : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef geometry_msgs::Quaternion _orientation_type; + _orientation_type orientation; + typedef geometry_msgs::Vector3 _angular_velocity_type; + _angular_velocity_type angular_velocity; + typedef geometry_msgs::Vector3 _linear_acceleration_type; + _linear_acceleration_type linear_acceleration; + typedef geometry_msgs::Vector3 _linear_velocity_type; + _linear_velocity_type linear_velocity; + typedef geographic_msgs::GeoPoint _geo_type; + _geo_type geo; + typedef float _ind_airspeed_type; + _ind_airspeed_type ind_airspeed; + typedef float _true_airspeed_type; + _true_airspeed_type true_airspeed; + + HilStateQuaternion(): + header(), + orientation(), + angular_velocity(), + linear_acceleration(), + linear_velocity(), + geo(), + ind_airspeed(0), + true_airspeed(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->orientation.serialize(outbuffer + offset); + offset += this->angular_velocity.serialize(outbuffer + offset); + offset += this->linear_acceleration.serialize(outbuffer + offset); + offset += this->linear_velocity.serialize(outbuffer + offset); + offset += this->geo.serialize(outbuffer + offset); + union { + float real; + uint32_t base; + } u_ind_airspeed; + u_ind_airspeed.real = this->ind_airspeed; + *(outbuffer + offset + 0) = (u_ind_airspeed.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_ind_airspeed.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_ind_airspeed.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_ind_airspeed.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->ind_airspeed); + union { + float real; + uint32_t base; + } u_true_airspeed; + u_true_airspeed.real = this->true_airspeed; + *(outbuffer + offset + 0) = (u_true_airspeed.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_true_airspeed.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_true_airspeed.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_true_airspeed.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->true_airspeed); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->orientation.deserialize(inbuffer + offset); + offset += this->angular_velocity.deserialize(inbuffer + offset); + offset += this->linear_acceleration.deserialize(inbuffer + offset); + offset += this->linear_velocity.deserialize(inbuffer + offset); + offset += this->geo.deserialize(inbuffer + offset); + union { + float real; + uint32_t base; + } u_ind_airspeed; + u_ind_airspeed.base = 0; + u_ind_airspeed.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_ind_airspeed.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_ind_airspeed.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_ind_airspeed.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->ind_airspeed = u_ind_airspeed.real; + offset += sizeof(this->ind_airspeed); + union { + float real; + uint32_t base; + } u_true_airspeed; + u_true_airspeed.base = 0; + u_true_airspeed.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_true_airspeed.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_true_airspeed.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_true_airspeed.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->true_airspeed = u_true_airspeed.real; + offset += sizeof(this->true_airspeed); + return offset; + } + + virtual const char * getType() override { return "mavros_msgs/HilStateQuaternion"; }; + virtual const char * getMD5() override { return "c858c0f05d4ab30256be7c53edee8e3c"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/HomePosition.h b/pio_workspace/lib/ros_lib/mavros_msgs/HomePosition.h new file mode 100644 index 0000000..6813ab1 --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/HomePosition.h @@ -0,0 +1,68 @@ +#ifndef _ROS_mavros_msgs_HomePosition_h +#define _ROS_mavros_msgs_HomePosition_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geographic_msgs/GeoPoint.h" +#include "geometry_msgs/Point.h" +#include "geometry_msgs/Quaternion.h" +#include "geometry_msgs/Vector3.h" + +namespace mavros_msgs +{ + + class HomePosition : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef geographic_msgs::GeoPoint _geo_type; + _geo_type geo; + typedef geometry_msgs::Point _position_type; + _position_type position; + typedef geometry_msgs::Quaternion _orientation_type; + _orientation_type orientation; + typedef geometry_msgs::Vector3 _approach_type; + _approach_type approach; + + HomePosition(): + header(), + geo(), + position(), + orientation(), + approach() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->geo.serialize(outbuffer + offset); + offset += this->position.serialize(outbuffer + offset); + offset += this->orientation.serialize(outbuffer + offset); + offset += this->approach.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->geo.deserialize(inbuffer + offset); + offset += this->position.deserialize(inbuffer + offset); + offset += this->orientation.deserialize(inbuffer + offset); + offset += this->approach.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "mavros_msgs/HomePosition"; }; + virtual const char * getMD5() override { return "c1167922de8c97acdb0ec714c1dba774"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/LandingTarget.h b/pio_workspace/lib/ros_lib/mavros_msgs/LandingTarget.h new file mode 100644 index 0000000..9055f21 --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/LandingTarget.h @@ -0,0 +1,165 @@ +#ifndef _ROS_mavros_msgs_LandingTarget_h +#define _ROS_mavros_msgs_LandingTarget_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Pose.h" + +namespace mavros_msgs +{ + + class LandingTarget : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef uint8_t _target_num_type; + _target_num_type target_num; + typedef uint8_t _frame_type; + _frame_type frame; + float angle[2]; + typedef float _distance_type; + _distance_type distance; + float size[2]; + typedef geometry_msgs::Pose _pose_type; + _pose_type pose; + typedef uint8_t _type_type; + _type_type type; + enum { GLOBAL = 0 }; + enum { LOCAL_NED = 2 }; + enum { MISSION = 3 }; + enum { GLOBAL_RELATIVE_ALT = 4 }; + enum { LOCAL_ENU = 5 }; + enum { GLOBAL_INT = 6 }; + enum { GLOBAL_RELATIVE_ALT_INT = 7 }; + enum { LOCAL_OFFSET_NED = 8 }; + enum { BODY_NED = 9 }; + enum { BODY_OFFSET_NED = 10 }; + enum { GLOBAL_TERRAIN_ALT = 11 }; + enum { GLOBAL_TERRAIN_ALT_INT = 12 }; + enum { LIGHT_BEACON = 0 }; + enum { RADIO_BEACON = 1 }; + enum { VISION_FIDUCIAL = 2 }; + enum { VISION_OTHER = 3 }; + + LandingTarget(): + header(), + target_num(0), + frame(0), + angle(), + distance(0), + size(), + pose(), + type(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->target_num >> (8 * 0)) & 0xFF; + offset += sizeof(this->target_num); + *(outbuffer + offset + 0) = (this->frame >> (8 * 0)) & 0xFF; + offset += sizeof(this->frame); + for( uint32_t i = 0; i < 2; i++){ + union { + float real; + uint32_t base; + } u_anglei; + u_anglei.real = this->angle[i]; + *(outbuffer + offset + 0) = (u_anglei.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_anglei.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_anglei.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_anglei.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->angle[i]); + } + union { + float real; + uint32_t base; + } u_distance; + u_distance.real = this->distance; + *(outbuffer + offset + 0) = (u_distance.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_distance.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_distance.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_distance.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->distance); + for( uint32_t i = 0; i < 2; i++){ + union { + float real; + uint32_t base; + } u_sizei; + u_sizei.real = this->size[i]; + *(outbuffer + offset + 0) = (u_sizei.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_sizei.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_sizei.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_sizei.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->size[i]); + } + offset += this->pose.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->type >> (8 * 0)) & 0xFF; + offset += sizeof(this->type); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + this->target_num = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->target_num); + this->frame = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->frame); + for( uint32_t i = 0; i < 2; i++){ + union { + float real; + uint32_t base; + } u_anglei; + u_anglei.base = 0; + u_anglei.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_anglei.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_anglei.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_anglei.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->angle[i] = u_anglei.real; + offset += sizeof(this->angle[i]); + } + union { + float real; + uint32_t base; + } u_distance; + u_distance.base = 0; + u_distance.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_distance.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_distance.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_distance.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->distance = u_distance.real; + offset += sizeof(this->distance); + for( uint32_t i = 0; i < 2; i++){ + union { + float real; + uint32_t base; + } u_sizei; + u_sizei.base = 0; + u_sizei.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_sizei.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_sizei.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_sizei.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->size[i] = u_sizei.real; + offset += sizeof(this->size[i]); + } + offset += this->pose.deserialize(inbuffer + offset); + this->type = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->type); + return offset; + } + + virtual const char * getType() override { return "mavros_msgs/LandingTarget"; }; + virtual const char * getMD5() override { return "76548ee08437914830bb7319d04d5490"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/LogData.h b/pio_workspace/lib/ros_lib/mavros_msgs/LogData.h new file mode 100644 index 0000000..c94ee60 --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/LogData.h @@ -0,0 +1,93 @@ +#ifndef _ROS_mavros_msgs_LogData_h +#define _ROS_mavros_msgs_LogData_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace mavros_msgs +{ + + class LogData : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef uint16_t _id_type; + _id_type id; + typedef uint32_t _offset_type; + _offset_type offset; + uint32_t data_length; + typedef uint8_t _data_type; + _data_type st_data; + _data_type * data; + + LogData(): + header(), + id(0), + offset(0), + data_length(0), st_data(), data(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->id >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->id >> (8 * 1)) & 0xFF; + offset += sizeof(this->id); + *(outbuffer + offset + 0) = (this->offset >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->offset >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->offset >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->offset >> (8 * 3)) & 0xFF; + offset += sizeof(this->offset); + *(outbuffer + offset + 0) = (this->data_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->data_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->data_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->data_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->data_length); + for( uint32_t i = 0; i < data_length; i++){ + *(outbuffer + offset + 0) = (this->data[i] >> (8 * 0)) & 0xFF; + offset += sizeof(this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + this->id = ((uint16_t) (*(inbuffer + offset))); + this->id |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->id); + this->offset = ((uint32_t) (*(inbuffer + offset))); + this->offset |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->offset |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->offset |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->offset); + uint32_t data_lengthT = ((uint32_t) (*(inbuffer + offset))); + data_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + data_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + data_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->data_length); + if(data_lengthT > data_length) + this->data = (uint8_t*)realloc(this->data, data_lengthT * sizeof(uint8_t)); + data_length = data_lengthT; + for( uint32_t i = 0; i < data_length; i++){ + this->st_data = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(uint8_t)); + } + return offset; + } + + virtual const char * getType() override { return "mavros_msgs/LogData"; }; + virtual const char * getMD5() override { return "ccaa27ba630f8f5d02c287763eb1e91b"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/LogEntry.h b/pio_workspace/lib/ros_lib/mavros_msgs/LogEntry.h new file mode 100644 index 0000000..05f936f --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/LogEntry.h @@ -0,0 +1,108 @@ +#ifndef _ROS_mavros_msgs_LogEntry_h +#define _ROS_mavros_msgs_LogEntry_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "ros/time.h" + +namespace mavros_msgs +{ + + class LogEntry : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef uint16_t _id_type; + _id_type id; + typedef uint16_t _num_logs_type; + _num_logs_type num_logs; + typedef uint16_t _last_log_num_type; + _last_log_num_type last_log_num; + typedef ros::Time _time_utc_type; + _time_utc_type time_utc; + typedef uint32_t _size_type; + _size_type size; + + LogEntry(): + header(), + id(0), + num_logs(0), + last_log_num(0), + time_utc(), + size(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->id >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->id >> (8 * 1)) & 0xFF; + offset += sizeof(this->id); + *(outbuffer + offset + 0) = (this->num_logs >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->num_logs >> (8 * 1)) & 0xFF; + offset += sizeof(this->num_logs); + *(outbuffer + offset + 0) = (this->last_log_num >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->last_log_num >> (8 * 1)) & 0xFF; + offset += sizeof(this->last_log_num); + *(outbuffer + offset + 0) = (this->time_utc.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->time_utc.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->time_utc.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->time_utc.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->time_utc.sec); + *(outbuffer + offset + 0) = (this->time_utc.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->time_utc.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->time_utc.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->time_utc.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->time_utc.nsec); + *(outbuffer + offset + 0) = (this->size >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->size >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->size >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->size >> (8 * 3)) & 0xFF; + offset += sizeof(this->size); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + this->id = ((uint16_t) (*(inbuffer + offset))); + this->id |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->id); + this->num_logs = ((uint16_t) (*(inbuffer + offset))); + this->num_logs |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->num_logs); + this->last_log_num = ((uint16_t) (*(inbuffer + offset))); + this->last_log_num |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->last_log_num); + this->time_utc.sec = ((uint32_t) (*(inbuffer + offset))); + this->time_utc.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->time_utc.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->time_utc.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->time_utc.sec); + this->time_utc.nsec = ((uint32_t) (*(inbuffer + offset))); + this->time_utc.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->time_utc.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->time_utc.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->time_utc.nsec); + this->size = ((uint32_t) (*(inbuffer + offset))); + this->size |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->size |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->size |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->size); + return offset; + } + + virtual const char * getType() override { return "mavros_msgs/LogEntry"; }; + virtual const char * getMD5() override { return "a1428fc1ec4b2bfc8ab0c0ead7cce571"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/LogRequestData.h b/pio_workspace/lib/ros_lib/mavros_msgs/LogRequestData.h new file mode 100644 index 0000000..520bfce --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/LogRequestData.h @@ -0,0 +1,123 @@ +#ifndef _ROS_SERVICE_LogRequestData_h +#define _ROS_SERVICE_LogRequestData_h +#include +#include +#include +#include "ros/msg.h" + +namespace mavros_msgs +{ + +static const char LOGREQUESTDATA[] = "mavros_msgs/LogRequestData"; + + class LogRequestDataRequest : public ros::Msg + { + public: + typedef uint16_t _id_type; + _id_type id; + typedef uint32_t _offset_type; + _offset_type offset; + typedef uint32_t _count_type; + _count_type count; + + LogRequestDataRequest(): + id(0), + offset(0), + count(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->id >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->id >> (8 * 1)) & 0xFF; + offset += sizeof(this->id); + *(outbuffer + offset + 0) = (this->offset >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->offset >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->offset >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->offset >> (8 * 3)) & 0xFF; + offset += sizeof(this->offset); + *(outbuffer + offset + 0) = (this->count >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->count >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->count >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->count >> (8 * 3)) & 0xFF; + offset += sizeof(this->count); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->id = ((uint16_t) (*(inbuffer + offset))); + this->id |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->id); + this->offset = ((uint32_t) (*(inbuffer + offset))); + this->offset |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->offset |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->offset |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->offset); + this->count = ((uint32_t) (*(inbuffer + offset))); + this->count |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->count |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->count |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->count); + return offset; + } + + virtual const char * getType() override { return LOGREQUESTDATA; }; + virtual const char * getMD5() override { return "9bd5fb12d79dcd29b3f845d7dd682415"; }; + + }; + + class LogRequestDataResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + + LogRequestDataResponse(): + success(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + return offset; + } + + virtual const char * getType() override { return LOGREQUESTDATA; }; + virtual const char * getMD5() override { return "358e233cde0c8a8bcfea4ce193f8fc15"; }; + + }; + + class LogRequestData { + public: + typedef LogRequestDataRequest Request; + typedef LogRequestDataResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/LogRequestEnd.h b/pio_workspace/lib/ros_lib/mavros_msgs/LogRequestEnd.h new file mode 100644 index 0000000..fa26cea --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/LogRequestEnd.h @@ -0,0 +1,88 @@ +#ifndef _ROS_SERVICE_LogRequestEnd_h +#define _ROS_SERVICE_LogRequestEnd_h +#include +#include +#include +#include "ros/msg.h" + +namespace mavros_msgs +{ + +static const char LOGREQUESTEND[] = "mavros_msgs/LogRequestEnd"; + + class LogRequestEndRequest : public ros::Msg + { + public: + + LogRequestEndRequest() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + return offset; + } + + virtual const char * getType() override { return LOGREQUESTEND; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class LogRequestEndResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + + LogRequestEndResponse(): + success(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + return offset; + } + + virtual const char * getType() override { return LOGREQUESTEND; }; + virtual const char * getMD5() override { return "358e233cde0c8a8bcfea4ce193f8fc15"; }; + + }; + + class LogRequestEnd { + public: + typedef LogRequestEndRequest Request; + typedef LogRequestEndResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/LogRequestList.h b/pio_workspace/lib/ros_lib/mavros_msgs/LogRequestList.h new file mode 100644 index 0000000..0a1a572 --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/LogRequestList.h @@ -0,0 +1,106 @@ +#ifndef _ROS_SERVICE_LogRequestList_h +#define _ROS_SERVICE_LogRequestList_h +#include +#include +#include +#include "ros/msg.h" + +namespace mavros_msgs +{ + +static const char LOGREQUESTLIST[] = "mavros_msgs/LogRequestList"; + + class LogRequestListRequest : public ros::Msg + { + public: + typedef uint16_t _start_type; + _start_type start; + typedef uint16_t _end_type; + _end_type end; + + LogRequestListRequest(): + start(0), + end(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->start >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->start >> (8 * 1)) & 0xFF; + offset += sizeof(this->start); + *(outbuffer + offset + 0) = (this->end >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->end >> (8 * 1)) & 0xFF; + offset += sizeof(this->end); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->start = ((uint16_t) (*(inbuffer + offset))); + this->start |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->start); + this->end = ((uint16_t) (*(inbuffer + offset))); + this->end |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->end); + return offset; + } + + virtual const char * getType() override { return LOGREQUESTLIST; }; + virtual const char * getMD5() override { return "43d5acd48e3ef1843fa7f45876501c02"; }; + + }; + + class LogRequestListResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + + LogRequestListResponse(): + success(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + return offset; + } + + virtual const char * getType() override { return LOGREQUESTLIST; }; + virtual const char * getMD5() override { return "358e233cde0c8a8bcfea4ce193f8fc15"; }; + + }; + + class LogRequestList { + public: + typedef LogRequestListRequest Request; + typedef LogRequestListResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/MagnetometerReporter.h b/pio_workspace/lib/ros_lib/mavros_msgs/MagnetometerReporter.h new file mode 100644 index 0000000..6eef0ba --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/MagnetometerReporter.h @@ -0,0 +1,75 @@ +#ifndef _ROS_mavros_msgs_MagnetometerReporter_h +#define _ROS_mavros_msgs_MagnetometerReporter_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace mavros_msgs +{ + + class MagnetometerReporter : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef uint8_t _report_type; + _report_type report; + typedef float _confidence_type; + _confidence_type confidence; + + MagnetometerReporter(): + header(), + report(0), + confidence(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->report >> (8 * 0)) & 0xFF; + offset += sizeof(this->report); + union { + float real; + uint32_t base; + } u_confidence; + u_confidence.real = this->confidence; + *(outbuffer + offset + 0) = (u_confidence.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_confidence.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_confidence.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_confidence.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->confidence); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + this->report = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->report); + union { + float real; + uint32_t base; + } u_confidence; + u_confidence.base = 0; + u_confidence.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_confidence.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_confidence.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_confidence.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->confidence = u_confidence.real; + offset += sizeof(this->confidence); + return offset; + } + + virtual const char * getType() override { return "mavros_msgs/MagnetometerReporter"; }; + virtual const char * getMD5() override { return "c1014202c8f02f171d3d0eef42920a2e"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/ManualControl.h b/pio_workspace/lib/ros_lib/mavros_msgs/ManualControl.h new file mode 100644 index 0000000..0e6b75c --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/ManualControl.h @@ -0,0 +1,149 @@ +#ifndef _ROS_mavros_msgs_ManualControl_h +#define _ROS_mavros_msgs_ManualControl_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace mavros_msgs +{ + + class ManualControl : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef float _x_type; + _x_type x; + typedef float _y_type; + _y_type y; + typedef float _z_type; + _z_type z; + typedef float _r_type; + _r_type r; + typedef uint16_t _buttons_type; + _buttons_type buttons; + + ManualControl(): + header(), + x(0), + y(0), + z(0), + r(0), + buttons(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + union { + float real; + uint32_t base; + } u_x; + u_x.real = this->x; + *(outbuffer + offset + 0) = (u_x.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_x.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_x.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_x.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->x); + union { + float real; + uint32_t base; + } u_y; + u_y.real = this->y; + *(outbuffer + offset + 0) = (u_y.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_y.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_y.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_y.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->y); + union { + float real; + uint32_t base; + } u_z; + u_z.real = this->z; + *(outbuffer + offset + 0) = (u_z.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_z.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_z.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_z.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->z); + union { + float real; + uint32_t base; + } u_r; + u_r.real = this->r; + *(outbuffer + offset + 0) = (u_r.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_r.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_r.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_r.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->r); + *(outbuffer + offset + 0) = (this->buttons >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->buttons >> (8 * 1)) & 0xFF; + offset += sizeof(this->buttons); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + union { + float real; + uint32_t base; + } u_x; + u_x.base = 0; + u_x.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->x = u_x.real; + offset += sizeof(this->x); + union { + float real; + uint32_t base; + } u_y; + u_y.base = 0; + u_y.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->y = u_y.real; + offset += sizeof(this->y); + union { + float real; + uint32_t base; + } u_z; + u_z.base = 0; + u_z.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_z.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_z.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_z.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->z = u_z.real; + offset += sizeof(this->z); + union { + float real; + uint32_t base; + } u_r; + u_r.base = 0; + u_r.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_r.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_r.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_r.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->r = u_r.real; + offset += sizeof(this->r); + this->buttons = ((uint16_t) (*(inbuffer + offset))); + this->buttons |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->buttons); + return offset; + } + + virtual const char * getType() override { return "mavros_msgs/ManualControl"; }; + virtual const char * getMD5() override { return "c41e3298484ea98e05ac502ce55af59f"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/Mavlink.h b/pio_workspace/lib/ros_lib/mavros_msgs/Mavlink.h new file mode 100644 index 0000000..ca4f078 --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/Mavlink.h @@ -0,0 +1,195 @@ +#ifndef _ROS_mavros_msgs_Mavlink_h +#define _ROS_mavros_msgs_Mavlink_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace mavros_msgs +{ + + class Mavlink : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef uint8_t _framing_status_type; + _framing_status_type framing_status; + typedef uint8_t _magic_type; + _magic_type magic; + typedef uint8_t _len_type; + _len_type len; + typedef uint8_t _incompat_flags_type; + _incompat_flags_type incompat_flags; + typedef uint8_t _compat_flags_type; + _compat_flags_type compat_flags; + typedef uint8_t _seq_type; + _seq_type seq; + typedef uint8_t _sysid_type; + _sysid_type sysid; + typedef uint8_t _compid_type; + _compid_type compid; + typedef uint32_t _msgid_type; + _msgid_type msgid; + typedef uint16_t _checksum_type; + _checksum_type checksum; + uint32_t payload64_length; + typedef uint64_t _payload64_type; + _payload64_type st_payload64; + _payload64_type * payload64; + uint32_t signature_length; + typedef uint8_t _signature_type; + _signature_type st_signature; + _signature_type * signature; + enum { FRAMING_OK = 1 }; + enum { FRAMING_BAD_CRC = 2 }; + enum { FRAMING_BAD_SIGNATURE = 3 }; + enum { MAVLINK_V10 = 254 }; + enum { MAVLINK_V20 = 253 }; + + Mavlink(): + header(), + framing_status(0), + magic(0), + len(0), + incompat_flags(0), + compat_flags(0), + seq(0), + sysid(0), + compid(0), + msgid(0), + checksum(0), + payload64_length(0), st_payload64(), payload64(nullptr), + signature_length(0), st_signature(), signature(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->framing_status >> (8 * 0)) & 0xFF; + offset += sizeof(this->framing_status); + *(outbuffer + offset + 0) = (this->magic >> (8 * 0)) & 0xFF; + offset += sizeof(this->magic); + *(outbuffer + offset + 0) = (this->len >> (8 * 0)) & 0xFF; + offset += sizeof(this->len); + *(outbuffer + offset + 0) = (this->incompat_flags >> (8 * 0)) & 0xFF; + offset += sizeof(this->incompat_flags); + *(outbuffer + offset + 0) = (this->compat_flags >> (8 * 0)) & 0xFF; + offset += sizeof(this->compat_flags); + *(outbuffer + offset + 0) = (this->seq >> (8 * 0)) & 0xFF; + offset += sizeof(this->seq); + *(outbuffer + offset + 0) = (this->sysid >> (8 * 0)) & 0xFF; + offset += sizeof(this->sysid); + *(outbuffer + offset + 0) = (this->compid >> (8 * 0)) & 0xFF; + offset += sizeof(this->compid); + *(outbuffer + offset + 0) = (this->msgid >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->msgid >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->msgid >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->msgid >> (8 * 3)) & 0xFF; + offset += sizeof(this->msgid); + *(outbuffer + offset + 0) = (this->checksum >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->checksum >> (8 * 1)) & 0xFF; + offset += sizeof(this->checksum); + *(outbuffer + offset + 0) = (this->payload64_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->payload64_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->payload64_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->payload64_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->payload64_length); + for( uint32_t i = 0; i < payload64_length; i++){ + *(outbuffer + offset + 0) = (this->payload64[i] >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->payload64[i] >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->payload64[i] >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->payload64[i] >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (this->payload64[i] >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (this->payload64[i] >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (this->payload64[i] >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (this->payload64[i] >> (8 * 7)) & 0xFF; + offset += sizeof(this->payload64[i]); + } + *(outbuffer + offset + 0) = (this->signature_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->signature_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->signature_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->signature_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->signature_length); + for( uint32_t i = 0; i < signature_length; i++){ + *(outbuffer + offset + 0) = (this->signature[i] >> (8 * 0)) & 0xFF; + offset += sizeof(this->signature[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + this->framing_status = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->framing_status); + this->magic = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->magic); + this->len = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->len); + this->incompat_flags = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->incompat_flags); + this->compat_flags = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->compat_flags); + this->seq = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->seq); + this->sysid = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->sysid); + this->compid = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->compid); + this->msgid = ((uint32_t) (*(inbuffer + offset))); + this->msgid |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->msgid |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->msgid |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->msgid); + this->checksum = ((uint16_t) (*(inbuffer + offset))); + this->checksum |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->checksum); + uint32_t payload64_lengthT = ((uint32_t) (*(inbuffer + offset))); + payload64_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + payload64_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + payload64_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->payload64_length); + if(payload64_lengthT > payload64_length) + this->payload64 = (uint64_t*)realloc(this->payload64, payload64_lengthT * sizeof(uint64_t)); + payload64_length = payload64_lengthT; + for( uint32_t i = 0; i < payload64_length; i++){ + this->st_payload64 = ((uint64_t) (*(inbuffer + offset))); + this->st_payload64 |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->st_payload64 |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->st_payload64 |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_payload64 |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + this->st_payload64 |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + this->st_payload64 |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + this->st_payload64 |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + offset += sizeof(this->st_payload64); + memcpy( &(this->payload64[i]), &(this->st_payload64), sizeof(uint64_t)); + } + uint32_t signature_lengthT = ((uint32_t) (*(inbuffer + offset))); + signature_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + signature_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + signature_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->signature_length); + if(signature_lengthT > signature_length) + this->signature = (uint8_t*)realloc(this->signature, signature_lengthT * sizeof(uint8_t)); + signature_length = signature_lengthT; + for( uint32_t i = 0; i < signature_length; i++){ + this->st_signature = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->st_signature); + memcpy( &(this->signature[i]), &(this->st_signature), sizeof(uint8_t)); + } + return offset; + } + + virtual const char * getType() override { return "mavros_msgs/Mavlink"; }; + virtual const char * getMD5() override { return "41093e1fd0f3eea1da2aa33a177e5ba6"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/MessageInterval.h b/pio_workspace/lib/ros_lib/mavros_msgs/MessageInterval.h new file mode 100644 index 0000000..9bf5941 --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/MessageInterval.h @@ -0,0 +1,125 @@ +#ifndef _ROS_SERVICE_MessageInterval_h +#define _ROS_SERVICE_MessageInterval_h +#include +#include +#include +#include "ros/msg.h" + +namespace mavros_msgs +{ + +static const char MESSAGEINTERVAL[] = "mavros_msgs/MessageInterval"; + + class MessageIntervalRequest : public ros::Msg + { + public: + typedef uint32_t _message_id_type; + _message_id_type message_id; + typedef float _message_rate_type; + _message_rate_type message_rate; + + MessageIntervalRequest(): + message_id(0), + message_rate(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->message_id >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->message_id >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->message_id >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->message_id >> (8 * 3)) & 0xFF; + offset += sizeof(this->message_id); + union { + float real; + uint32_t base; + } u_message_rate; + u_message_rate.real = this->message_rate; + *(outbuffer + offset + 0) = (u_message_rate.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_message_rate.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_message_rate.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_message_rate.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->message_rate); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->message_id = ((uint32_t) (*(inbuffer + offset))); + this->message_id |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->message_id |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->message_id |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->message_id); + union { + float real; + uint32_t base; + } u_message_rate; + u_message_rate.base = 0; + u_message_rate.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_message_rate.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_message_rate.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_message_rate.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->message_rate = u_message_rate.real; + offset += sizeof(this->message_rate); + return offset; + } + + virtual const char * getType() override { return MESSAGEINTERVAL; }; + virtual const char * getMD5() override { return "e0211a7928924521de24f3981706be52"; }; + + }; + + class MessageIntervalResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + + MessageIntervalResponse(): + success(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + return offset; + } + + virtual const char * getType() override { return MESSAGEINTERVAL; }; + virtual const char * getMD5() override { return "358e233cde0c8a8bcfea4ce193f8fc15"; }; + + }; + + class MessageInterval { + public: + typedef MessageIntervalRequest Request; + typedef MessageIntervalResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/MountConfigure.h b/pio_workspace/lib/ros_lib/mavros_msgs/MountConfigure.h new file mode 100644 index 0000000..d956001 --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/MountConfigure.h @@ -0,0 +1,191 @@ +#ifndef _ROS_SERVICE_MountConfigure_h +#define _ROS_SERVICE_MountConfigure_h +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace mavros_msgs +{ + +static const char MOUNTCONFIGURE[] = "mavros_msgs/MountConfigure"; + + class MountConfigureRequest : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef uint8_t _mode_type; + _mode_type mode; + typedef bool _stabilize_roll_type; + _stabilize_roll_type stabilize_roll; + typedef bool _stabilize_pitch_type; + _stabilize_pitch_type stabilize_pitch; + typedef bool _stabilize_yaw_type; + _stabilize_yaw_type stabilize_yaw; + typedef uint8_t _roll_input_type; + _roll_input_type roll_input; + typedef uint8_t _pitch_input_type; + _pitch_input_type pitch_input; + typedef uint8_t _yaw_input_type; + _yaw_input_type yaw_input; + enum { MODE_RETRACT = 0 }; + enum { MODE_NEUTRAL = 1 }; + enum { MODE_MAVLINK_TARGETING = 2 }; + enum { MODE_RC_TARGETING = 3 }; + enum { MODE_GPS_POINT = 4 }; + enum { INPUT_ANGLE_BODY_FRAME = 0 }; + enum { INPUT_ANGULAR_RATE = 1 }; + enum { INPUT_ANGLE_ABSOLUTE_FRAME = 2 }; + + MountConfigureRequest(): + header(), + mode(0), + stabilize_roll(0), + stabilize_pitch(0), + stabilize_yaw(0), + roll_input(0), + pitch_input(0), + yaw_input(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->mode >> (8 * 0)) & 0xFF; + offset += sizeof(this->mode); + union { + bool real; + uint8_t base; + } u_stabilize_roll; + u_stabilize_roll.real = this->stabilize_roll; + *(outbuffer + offset + 0) = (u_stabilize_roll.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->stabilize_roll); + union { + bool real; + uint8_t base; + } u_stabilize_pitch; + u_stabilize_pitch.real = this->stabilize_pitch; + *(outbuffer + offset + 0) = (u_stabilize_pitch.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->stabilize_pitch); + union { + bool real; + uint8_t base; + } u_stabilize_yaw; + u_stabilize_yaw.real = this->stabilize_yaw; + *(outbuffer + offset + 0) = (u_stabilize_yaw.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->stabilize_yaw); + *(outbuffer + offset + 0) = (this->roll_input >> (8 * 0)) & 0xFF; + offset += sizeof(this->roll_input); + *(outbuffer + offset + 0) = (this->pitch_input >> (8 * 0)) & 0xFF; + offset += sizeof(this->pitch_input); + *(outbuffer + offset + 0) = (this->yaw_input >> (8 * 0)) & 0xFF; + offset += sizeof(this->yaw_input); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + this->mode = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->mode); + union { + bool real; + uint8_t base; + } u_stabilize_roll; + u_stabilize_roll.base = 0; + u_stabilize_roll.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->stabilize_roll = u_stabilize_roll.real; + offset += sizeof(this->stabilize_roll); + union { + bool real; + uint8_t base; + } u_stabilize_pitch; + u_stabilize_pitch.base = 0; + u_stabilize_pitch.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->stabilize_pitch = u_stabilize_pitch.real; + offset += sizeof(this->stabilize_pitch); + union { + bool real; + uint8_t base; + } u_stabilize_yaw; + u_stabilize_yaw.base = 0; + u_stabilize_yaw.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->stabilize_yaw = u_stabilize_yaw.real; + offset += sizeof(this->stabilize_yaw); + this->roll_input = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->roll_input); + this->pitch_input = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->pitch_input); + this->yaw_input = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->yaw_input); + return offset; + } + + virtual const char * getType() override { return MOUNTCONFIGURE; }; + virtual const char * getMD5() override { return "6abfbffc4f7b14d5b05955b1813ae50e"; }; + + }; + + class MountConfigureResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + typedef uint8_t _result_type; + _result_type result; + + MountConfigureResponse(): + success(0), + result(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + *(outbuffer + offset + 0) = (this->result >> (8 * 0)) & 0xFF; + offset += sizeof(this->result); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + this->result = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->result); + return offset; + } + + virtual const char * getType() override { return MOUNTCONFIGURE; }; + virtual const char * getMD5() override { return "1cd894375e4e3d2861d2222772894fdb"; }; + + }; + + class MountConfigure { + public: + typedef MountConfigureRequest Request; + typedef MountConfigureResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/MountControl.h b/pio_workspace/lib/ros_lib/mavros_msgs/MountControl.h new file mode 100644 index 0000000..4587afb --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/MountControl.h @@ -0,0 +1,200 @@ +#ifndef _ROS_mavros_msgs_MountControl_h +#define _ROS_mavros_msgs_MountControl_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace mavros_msgs +{ + + class MountControl : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef uint8_t _mode_type; + _mode_type mode; + typedef float _pitch_type; + _pitch_type pitch; + typedef float _roll_type; + _roll_type roll; + typedef float _yaw_type; + _yaw_type yaw; + typedef float _altitude_type; + _altitude_type altitude; + typedef float _latitude_type; + _latitude_type latitude; + typedef float _longitude_type; + _longitude_type longitude; + enum { MAV_MOUNT_MODE_RETRACT = 0 }; + enum { MAV_MOUNT_MODE_NEUTRAL = 1 }; + enum { MAV_MOUNT_MODE_MAVLINK_TARGETING = 2 }; + enum { MAV_MOUNT_MODE_RC_TARGETING = 3 }; + enum { MAV_MOUNT_MODE_GPS_POINT = 4 }; + + MountControl(): + header(), + mode(0), + pitch(0), + roll(0), + yaw(0), + altitude(0), + latitude(0), + longitude(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->mode >> (8 * 0)) & 0xFF; + offset += sizeof(this->mode); + union { + float real; + uint32_t base; + } u_pitch; + u_pitch.real = this->pitch; + *(outbuffer + offset + 0) = (u_pitch.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_pitch.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_pitch.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_pitch.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->pitch); + union { + float real; + uint32_t base; + } u_roll; + u_roll.real = this->roll; + *(outbuffer + offset + 0) = (u_roll.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_roll.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_roll.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_roll.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->roll); + union { + float real; + uint32_t base; + } u_yaw; + u_yaw.real = this->yaw; + *(outbuffer + offset + 0) = (u_yaw.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_yaw.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_yaw.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_yaw.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->yaw); + union { + float real; + uint32_t base; + } u_altitude; + u_altitude.real = this->altitude; + *(outbuffer + offset + 0) = (u_altitude.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_altitude.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_altitude.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_altitude.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->altitude); + union { + float real; + uint32_t base; + } u_latitude; + u_latitude.real = this->latitude; + *(outbuffer + offset + 0) = (u_latitude.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_latitude.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_latitude.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_latitude.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->latitude); + union { + float real; + uint32_t base; + } u_longitude; + u_longitude.real = this->longitude; + *(outbuffer + offset + 0) = (u_longitude.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_longitude.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_longitude.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_longitude.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->longitude); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + this->mode = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->mode); + union { + float real; + uint32_t base; + } u_pitch; + u_pitch.base = 0; + u_pitch.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_pitch.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_pitch.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_pitch.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->pitch = u_pitch.real; + offset += sizeof(this->pitch); + union { + float real; + uint32_t base; + } u_roll; + u_roll.base = 0; + u_roll.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_roll.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_roll.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_roll.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->roll = u_roll.real; + offset += sizeof(this->roll); + union { + float real; + uint32_t base; + } u_yaw; + u_yaw.base = 0; + u_yaw.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_yaw.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_yaw.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_yaw.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->yaw = u_yaw.real; + offset += sizeof(this->yaw); + union { + float real; + uint32_t base; + } u_altitude; + u_altitude.base = 0; + u_altitude.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_altitude.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_altitude.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_altitude.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->altitude = u_altitude.real; + offset += sizeof(this->altitude); + union { + float real; + uint32_t base; + } u_latitude; + u_latitude.base = 0; + u_latitude.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_latitude.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_latitude.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_latitude.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->latitude = u_latitude.real; + offset += sizeof(this->latitude); + union { + float real; + uint32_t base; + } u_longitude; + u_longitude.base = 0; + u_longitude.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_longitude.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_longitude.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_longitude.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->longitude = u_longitude.real; + offset += sizeof(this->longitude); + return offset; + } + + virtual const char * getType() override { return "mavros_msgs/MountControl"; }; + virtual const char * getMD5() override { return "214cf13a68b4fed9e2a77b1b436f144e"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/NavControllerOutput.h b/pio_workspace/lib/ros_lib/mavros_msgs/NavControllerOutput.h new file mode 100644 index 0000000..5998ae7 --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/NavControllerOutput.h @@ -0,0 +1,213 @@ +#ifndef _ROS_mavros_msgs_NavControllerOutput_h +#define _ROS_mavros_msgs_NavControllerOutput_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace mavros_msgs +{ + + class NavControllerOutput : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef float _nav_roll_type; + _nav_roll_type nav_roll; + typedef float _nav_pitch_type; + _nav_pitch_type nav_pitch; + typedef int16_t _nav_bearing_type; + _nav_bearing_type nav_bearing; + typedef int16_t _target_bearing_type; + _target_bearing_type target_bearing; + typedef uint16_t _wp_dist_type; + _wp_dist_type wp_dist; + typedef float _alt_error_type; + _alt_error_type alt_error; + typedef float _aspd_error_type; + _aspd_error_type aspd_error; + typedef float _xtrack_error_type; + _xtrack_error_type xtrack_error; + + NavControllerOutput(): + header(), + nav_roll(0), + nav_pitch(0), + nav_bearing(0), + target_bearing(0), + wp_dist(0), + alt_error(0), + aspd_error(0), + xtrack_error(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + union { + float real; + uint32_t base; + } u_nav_roll; + u_nav_roll.real = this->nav_roll; + *(outbuffer + offset + 0) = (u_nav_roll.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_nav_roll.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_nav_roll.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_nav_roll.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->nav_roll); + union { + float real; + uint32_t base; + } u_nav_pitch; + u_nav_pitch.real = this->nav_pitch; + *(outbuffer + offset + 0) = (u_nav_pitch.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_nav_pitch.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_nav_pitch.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_nav_pitch.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->nav_pitch); + union { + int16_t real; + uint16_t base; + } u_nav_bearing; + u_nav_bearing.real = this->nav_bearing; + *(outbuffer + offset + 0) = (u_nav_bearing.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_nav_bearing.base >> (8 * 1)) & 0xFF; + offset += sizeof(this->nav_bearing); + union { + int16_t real; + uint16_t base; + } u_target_bearing; + u_target_bearing.real = this->target_bearing; + *(outbuffer + offset + 0) = (u_target_bearing.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_target_bearing.base >> (8 * 1)) & 0xFF; + offset += sizeof(this->target_bearing); + *(outbuffer + offset + 0) = (this->wp_dist >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->wp_dist >> (8 * 1)) & 0xFF; + offset += sizeof(this->wp_dist); + union { + float real; + uint32_t base; + } u_alt_error; + u_alt_error.real = this->alt_error; + *(outbuffer + offset + 0) = (u_alt_error.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_alt_error.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_alt_error.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_alt_error.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->alt_error); + union { + float real; + uint32_t base; + } u_aspd_error; + u_aspd_error.real = this->aspd_error; + *(outbuffer + offset + 0) = (u_aspd_error.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_aspd_error.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_aspd_error.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_aspd_error.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->aspd_error); + union { + float real; + uint32_t base; + } u_xtrack_error; + u_xtrack_error.real = this->xtrack_error; + *(outbuffer + offset + 0) = (u_xtrack_error.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_xtrack_error.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_xtrack_error.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_xtrack_error.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->xtrack_error); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + union { + float real; + uint32_t base; + } u_nav_roll; + u_nav_roll.base = 0; + u_nav_roll.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_nav_roll.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_nav_roll.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_nav_roll.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->nav_roll = u_nav_roll.real; + offset += sizeof(this->nav_roll); + union { + float real; + uint32_t base; + } u_nav_pitch; + u_nav_pitch.base = 0; + u_nav_pitch.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_nav_pitch.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_nav_pitch.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_nav_pitch.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->nav_pitch = u_nav_pitch.real; + offset += sizeof(this->nav_pitch); + union { + int16_t real; + uint16_t base; + } u_nav_bearing; + u_nav_bearing.base = 0; + u_nav_bearing.base |= ((uint16_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_nav_bearing.base |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->nav_bearing = u_nav_bearing.real; + offset += sizeof(this->nav_bearing); + union { + int16_t real; + uint16_t base; + } u_target_bearing; + u_target_bearing.base = 0; + u_target_bearing.base |= ((uint16_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_target_bearing.base |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->target_bearing = u_target_bearing.real; + offset += sizeof(this->target_bearing); + this->wp_dist = ((uint16_t) (*(inbuffer + offset))); + this->wp_dist |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->wp_dist); + union { + float real; + uint32_t base; + } u_alt_error; + u_alt_error.base = 0; + u_alt_error.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_alt_error.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_alt_error.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_alt_error.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->alt_error = u_alt_error.real; + offset += sizeof(this->alt_error); + union { + float real; + uint32_t base; + } u_aspd_error; + u_aspd_error.base = 0; + u_aspd_error.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_aspd_error.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_aspd_error.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_aspd_error.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->aspd_error = u_aspd_error.real; + offset += sizeof(this->aspd_error); + union { + float real; + uint32_t base; + } u_xtrack_error; + u_xtrack_error.base = 0; + u_xtrack_error.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_xtrack_error.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_xtrack_error.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_xtrack_error.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->xtrack_error = u_xtrack_error.real; + offset += sizeof(this->xtrack_error); + return offset; + } + + virtual const char * getType() override { return "mavros_msgs/NavControllerOutput"; }; + virtual const char * getMD5() override { return "f6340c9bb79e3ac2a6142ce592e66756"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/OnboardComputerStatus.h b/pio_workspace/lib/ros_lib/mavros_msgs/OnboardComputerStatus.h new file mode 100644 index 0000000..a08f950 --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/OnboardComputerStatus.h @@ -0,0 +1,327 @@ +#ifndef _ROS_mavros_msgs_OnboardComputerStatus_h +#define _ROS_mavros_msgs_OnboardComputerStatus_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace mavros_msgs +{ + + class OnboardComputerStatus : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef uint8_t _component_type; + _component_type component; + typedef uint32_t _uptime_type; + _uptime_type uptime; + typedef uint8_t _type_type; + _type_type type; + uint8_t cpu_cores[8]; + uint8_t cpu_combined[10]; + uint8_t gpu_cores[4]; + uint8_t gpu_combined[10]; + typedef int8_t _temperature_board_type; + _temperature_board_type temperature_board; + int8_t temperature_core[8]; + int16_t fan_speed[4]; + typedef uint32_t _ram_usage_type; + _ram_usage_type ram_usage; + typedef uint32_t _ram_total_type; + _ram_total_type ram_total; + uint32_t storage_type[4]; + uint32_t storage_usage[4]; + uint32_t storage_total[4]; + uint32_t link_type[6]; + uint32_t link_tx_rate[6]; + uint32_t link_rx_rate[6]; + uint32_t link_tx_max[6]; + uint32_t link_rx_max[6]; + + OnboardComputerStatus(): + header(), + component(0), + uptime(0), + type(0), + cpu_cores(), + cpu_combined(), + gpu_cores(), + gpu_combined(), + temperature_board(0), + temperature_core(), + fan_speed(), + ram_usage(0), + ram_total(0), + storage_type(), + storage_usage(), + storage_total(), + link_type(), + link_tx_rate(), + link_rx_rate(), + link_tx_max(), + link_rx_max() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->component >> (8 * 0)) & 0xFF; + offset += sizeof(this->component); + *(outbuffer + offset + 0) = (this->uptime >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->uptime >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->uptime >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->uptime >> (8 * 3)) & 0xFF; + offset += sizeof(this->uptime); + *(outbuffer + offset + 0) = (this->type >> (8 * 0)) & 0xFF; + offset += sizeof(this->type); + for( uint32_t i = 0; i < 8; i++){ + *(outbuffer + offset + 0) = (this->cpu_cores[i] >> (8 * 0)) & 0xFF; + offset += sizeof(this->cpu_cores[i]); + } + for( uint32_t i = 0; i < 10; i++){ + *(outbuffer + offset + 0) = (this->cpu_combined[i] >> (8 * 0)) & 0xFF; + offset += sizeof(this->cpu_combined[i]); + } + for( uint32_t i = 0; i < 4; i++){ + *(outbuffer + offset + 0) = (this->gpu_cores[i] >> (8 * 0)) & 0xFF; + offset += sizeof(this->gpu_cores[i]); + } + for( uint32_t i = 0; i < 10; i++){ + *(outbuffer + offset + 0) = (this->gpu_combined[i] >> (8 * 0)) & 0xFF; + offset += sizeof(this->gpu_combined[i]); + } + union { + int8_t real; + uint8_t base; + } u_temperature_board; + u_temperature_board.real = this->temperature_board; + *(outbuffer + offset + 0) = (u_temperature_board.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->temperature_board); + for( uint32_t i = 0; i < 8; i++){ + union { + int8_t real; + uint8_t base; + } u_temperature_corei; + u_temperature_corei.real = this->temperature_core[i]; + *(outbuffer + offset + 0) = (u_temperature_corei.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->temperature_core[i]); + } + for( uint32_t i = 0; i < 4; i++){ + union { + int16_t real; + uint16_t base; + } u_fan_speedi; + u_fan_speedi.real = this->fan_speed[i]; + *(outbuffer + offset + 0) = (u_fan_speedi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_fan_speedi.base >> (8 * 1)) & 0xFF; + offset += sizeof(this->fan_speed[i]); + } + *(outbuffer + offset + 0) = (this->ram_usage >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->ram_usage >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->ram_usage >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->ram_usage >> (8 * 3)) & 0xFF; + offset += sizeof(this->ram_usage); + *(outbuffer + offset + 0) = (this->ram_total >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->ram_total >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->ram_total >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->ram_total >> (8 * 3)) & 0xFF; + offset += sizeof(this->ram_total); + for( uint32_t i = 0; i < 4; i++){ + *(outbuffer + offset + 0) = (this->storage_type[i] >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->storage_type[i] >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->storage_type[i] >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->storage_type[i] >> (8 * 3)) & 0xFF; + offset += sizeof(this->storage_type[i]); + } + for( uint32_t i = 0; i < 4; i++){ + *(outbuffer + offset + 0) = (this->storage_usage[i] >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->storage_usage[i] >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->storage_usage[i] >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->storage_usage[i] >> (8 * 3)) & 0xFF; + offset += sizeof(this->storage_usage[i]); + } + for( uint32_t i = 0; i < 4; i++){ + *(outbuffer + offset + 0) = (this->storage_total[i] >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->storage_total[i] >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->storage_total[i] >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->storage_total[i] >> (8 * 3)) & 0xFF; + offset += sizeof(this->storage_total[i]); + } + for( uint32_t i = 0; i < 6; i++){ + *(outbuffer + offset + 0) = (this->link_type[i] >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->link_type[i] >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->link_type[i] >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->link_type[i] >> (8 * 3)) & 0xFF; + offset += sizeof(this->link_type[i]); + } + for( uint32_t i = 0; i < 6; i++){ + *(outbuffer + offset + 0) = (this->link_tx_rate[i] >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->link_tx_rate[i] >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->link_tx_rate[i] >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->link_tx_rate[i] >> (8 * 3)) & 0xFF; + offset += sizeof(this->link_tx_rate[i]); + } + for( uint32_t i = 0; i < 6; i++){ + *(outbuffer + offset + 0) = (this->link_rx_rate[i] >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->link_rx_rate[i] >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->link_rx_rate[i] >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->link_rx_rate[i] >> (8 * 3)) & 0xFF; + offset += sizeof(this->link_rx_rate[i]); + } + for( uint32_t i = 0; i < 6; i++){ + *(outbuffer + offset + 0) = (this->link_tx_max[i] >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->link_tx_max[i] >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->link_tx_max[i] >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->link_tx_max[i] >> (8 * 3)) & 0xFF; + offset += sizeof(this->link_tx_max[i]); + } + for( uint32_t i = 0; i < 6; i++){ + *(outbuffer + offset + 0) = (this->link_rx_max[i] >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->link_rx_max[i] >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->link_rx_max[i] >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->link_rx_max[i] >> (8 * 3)) & 0xFF; + offset += sizeof(this->link_rx_max[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + this->component = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->component); + this->uptime = ((uint32_t) (*(inbuffer + offset))); + this->uptime |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->uptime |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->uptime |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->uptime); + this->type = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->type); + for( uint32_t i = 0; i < 8; i++){ + this->cpu_cores[i] = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->cpu_cores[i]); + } + for( uint32_t i = 0; i < 10; i++){ + this->cpu_combined[i] = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->cpu_combined[i]); + } + for( uint32_t i = 0; i < 4; i++){ + this->gpu_cores[i] = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->gpu_cores[i]); + } + for( uint32_t i = 0; i < 10; i++){ + this->gpu_combined[i] = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->gpu_combined[i]); + } + union { + int8_t real; + uint8_t base; + } u_temperature_board; + u_temperature_board.base = 0; + u_temperature_board.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->temperature_board = u_temperature_board.real; + offset += sizeof(this->temperature_board); + for( uint32_t i = 0; i < 8; i++){ + union { + int8_t real; + uint8_t base; + } u_temperature_corei; + u_temperature_corei.base = 0; + u_temperature_corei.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->temperature_core[i] = u_temperature_corei.real; + offset += sizeof(this->temperature_core[i]); + } + for( uint32_t i = 0; i < 4; i++){ + union { + int16_t real; + uint16_t base; + } u_fan_speedi; + u_fan_speedi.base = 0; + u_fan_speedi.base |= ((uint16_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_fan_speedi.base |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->fan_speed[i] = u_fan_speedi.real; + offset += sizeof(this->fan_speed[i]); + } + this->ram_usage = ((uint32_t) (*(inbuffer + offset))); + this->ram_usage |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->ram_usage |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->ram_usage |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->ram_usage); + this->ram_total = ((uint32_t) (*(inbuffer + offset))); + this->ram_total |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->ram_total |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->ram_total |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->ram_total); + for( uint32_t i = 0; i < 4; i++){ + this->storage_type[i] = ((uint32_t) (*(inbuffer + offset))); + this->storage_type[i] |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->storage_type[i] |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->storage_type[i] |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->storage_type[i]); + } + for( uint32_t i = 0; i < 4; i++){ + this->storage_usage[i] = ((uint32_t) (*(inbuffer + offset))); + this->storage_usage[i] |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->storage_usage[i] |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->storage_usage[i] |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->storage_usage[i]); + } + for( uint32_t i = 0; i < 4; i++){ + this->storage_total[i] = ((uint32_t) (*(inbuffer + offset))); + this->storage_total[i] |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->storage_total[i] |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->storage_total[i] |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->storage_total[i]); + } + for( uint32_t i = 0; i < 6; i++){ + this->link_type[i] = ((uint32_t) (*(inbuffer + offset))); + this->link_type[i] |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->link_type[i] |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->link_type[i] |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->link_type[i]); + } + for( uint32_t i = 0; i < 6; i++){ + this->link_tx_rate[i] = ((uint32_t) (*(inbuffer + offset))); + this->link_tx_rate[i] |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->link_tx_rate[i] |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->link_tx_rate[i] |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->link_tx_rate[i]); + } + for( uint32_t i = 0; i < 6; i++){ + this->link_rx_rate[i] = ((uint32_t) (*(inbuffer + offset))); + this->link_rx_rate[i] |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->link_rx_rate[i] |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->link_rx_rate[i] |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->link_rx_rate[i]); + } + for( uint32_t i = 0; i < 6; i++){ + this->link_tx_max[i] = ((uint32_t) (*(inbuffer + offset))); + this->link_tx_max[i] |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->link_tx_max[i] |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->link_tx_max[i] |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->link_tx_max[i]); + } + for( uint32_t i = 0; i < 6; i++){ + this->link_rx_max[i] = ((uint32_t) (*(inbuffer + offset))); + this->link_rx_max[i] |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->link_rx_max[i] |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->link_rx_max[i] |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->link_rx_max[i]); + } + return offset; + } + + virtual const char * getType() override { return "mavros_msgs/OnboardComputerStatus"; }; + virtual const char * getMD5() override { return "aebe864fac2952ca9de45a2b65875a60"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/OpticalFlowRad.h b/pio_workspace/lib/ros_lib/mavros_msgs/OpticalFlowRad.h new file mode 100644 index 0000000..3b9f7fc --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/OpticalFlowRad.h @@ -0,0 +1,241 @@ +#ifndef _ROS_mavros_msgs_OpticalFlowRad_h +#define _ROS_mavros_msgs_OpticalFlowRad_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace mavros_msgs +{ + + class OpticalFlowRad : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef uint32_t _integration_time_us_type; + _integration_time_us_type integration_time_us; + typedef float _integrated_x_type; + _integrated_x_type integrated_x; + typedef float _integrated_y_type; + _integrated_y_type integrated_y; + typedef float _integrated_xgyro_type; + _integrated_xgyro_type integrated_xgyro; + typedef float _integrated_ygyro_type; + _integrated_ygyro_type integrated_ygyro; + typedef float _integrated_zgyro_type; + _integrated_zgyro_type integrated_zgyro; + typedef int16_t _temperature_type; + _temperature_type temperature; + typedef uint8_t _quality_type; + _quality_type quality; + typedef uint32_t _time_delta_distance_us_type; + _time_delta_distance_us_type time_delta_distance_us; + typedef float _distance_type; + _distance_type distance; + + OpticalFlowRad(): + header(), + integration_time_us(0), + integrated_x(0), + integrated_y(0), + integrated_xgyro(0), + integrated_ygyro(0), + integrated_zgyro(0), + temperature(0), + quality(0), + time_delta_distance_us(0), + distance(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->integration_time_us >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->integration_time_us >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->integration_time_us >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->integration_time_us >> (8 * 3)) & 0xFF; + offset += sizeof(this->integration_time_us); + union { + float real; + uint32_t base; + } u_integrated_x; + u_integrated_x.real = this->integrated_x; + *(outbuffer + offset + 0) = (u_integrated_x.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_integrated_x.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_integrated_x.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_integrated_x.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->integrated_x); + union { + float real; + uint32_t base; + } u_integrated_y; + u_integrated_y.real = this->integrated_y; + *(outbuffer + offset + 0) = (u_integrated_y.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_integrated_y.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_integrated_y.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_integrated_y.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->integrated_y); + union { + float real; + uint32_t base; + } u_integrated_xgyro; + u_integrated_xgyro.real = this->integrated_xgyro; + *(outbuffer + offset + 0) = (u_integrated_xgyro.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_integrated_xgyro.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_integrated_xgyro.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_integrated_xgyro.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->integrated_xgyro); + union { + float real; + uint32_t base; + } u_integrated_ygyro; + u_integrated_ygyro.real = this->integrated_ygyro; + *(outbuffer + offset + 0) = (u_integrated_ygyro.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_integrated_ygyro.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_integrated_ygyro.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_integrated_ygyro.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->integrated_ygyro); + union { + float real; + uint32_t base; + } u_integrated_zgyro; + u_integrated_zgyro.real = this->integrated_zgyro; + *(outbuffer + offset + 0) = (u_integrated_zgyro.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_integrated_zgyro.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_integrated_zgyro.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_integrated_zgyro.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->integrated_zgyro); + union { + int16_t real; + uint16_t base; + } u_temperature; + u_temperature.real = this->temperature; + *(outbuffer + offset + 0) = (u_temperature.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_temperature.base >> (8 * 1)) & 0xFF; + offset += sizeof(this->temperature); + *(outbuffer + offset + 0) = (this->quality >> (8 * 0)) & 0xFF; + offset += sizeof(this->quality); + *(outbuffer + offset + 0) = (this->time_delta_distance_us >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->time_delta_distance_us >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->time_delta_distance_us >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->time_delta_distance_us >> (8 * 3)) & 0xFF; + offset += sizeof(this->time_delta_distance_us); + union { + float real; + uint32_t base; + } u_distance; + u_distance.real = this->distance; + *(outbuffer + offset + 0) = (u_distance.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_distance.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_distance.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_distance.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->distance); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + this->integration_time_us = ((uint32_t) (*(inbuffer + offset))); + this->integration_time_us |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->integration_time_us |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->integration_time_us |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->integration_time_us); + union { + float real; + uint32_t base; + } u_integrated_x; + u_integrated_x.base = 0; + u_integrated_x.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_integrated_x.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_integrated_x.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_integrated_x.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->integrated_x = u_integrated_x.real; + offset += sizeof(this->integrated_x); + union { + float real; + uint32_t base; + } u_integrated_y; + u_integrated_y.base = 0; + u_integrated_y.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_integrated_y.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_integrated_y.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_integrated_y.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->integrated_y = u_integrated_y.real; + offset += sizeof(this->integrated_y); + union { + float real; + uint32_t base; + } u_integrated_xgyro; + u_integrated_xgyro.base = 0; + u_integrated_xgyro.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_integrated_xgyro.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_integrated_xgyro.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_integrated_xgyro.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->integrated_xgyro = u_integrated_xgyro.real; + offset += sizeof(this->integrated_xgyro); + union { + float real; + uint32_t base; + } u_integrated_ygyro; + u_integrated_ygyro.base = 0; + u_integrated_ygyro.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_integrated_ygyro.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_integrated_ygyro.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_integrated_ygyro.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->integrated_ygyro = u_integrated_ygyro.real; + offset += sizeof(this->integrated_ygyro); + union { + float real; + uint32_t base; + } u_integrated_zgyro; + u_integrated_zgyro.base = 0; + u_integrated_zgyro.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_integrated_zgyro.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_integrated_zgyro.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_integrated_zgyro.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->integrated_zgyro = u_integrated_zgyro.real; + offset += sizeof(this->integrated_zgyro); + union { + int16_t real; + uint16_t base; + } u_temperature; + u_temperature.base = 0; + u_temperature.base |= ((uint16_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_temperature.base |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->temperature = u_temperature.real; + offset += sizeof(this->temperature); + this->quality = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->quality); + this->time_delta_distance_us = ((uint32_t) (*(inbuffer + offset))); + this->time_delta_distance_us |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->time_delta_distance_us |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->time_delta_distance_us |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->time_delta_distance_us); + union { + float real; + uint32_t base; + } u_distance; + u_distance.base = 0; + u_distance.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_distance.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_distance.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_distance.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->distance = u_distance.real; + offset += sizeof(this->distance); + return offset; + } + + virtual const char * getType() override { return "mavros_msgs/OpticalFlowRad"; }; + virtual const char * getMD5() override { return "65d93e03c6188c7ee30415b2a39ad40d"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/OverrideRCIn.h b/pio_workspace/lib/ros_lib/mavros_msgs/OverrideRCIn.h new file mode 100644 index 0000000..5ff4ceb --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/OverrideRCIn.h @@ -0,0 +1,52 @@ +#ifndef _ROS_mavros_msgs_OverrideRCIn_h +#define _ROS_mavros_msgs_OverrideRCIn_h + +#include +#include +#include +#include "ros/msg.h" + +namespace mavros_msgs +{ + + class OverrideRCIn : public ros::Msg + { + public: + uint16_t channels[18]; + enum { CHAN_RELEASE = 0 }; + enum { CHAN_NOCHANGE = 65535 }; + + OverrideRCIn(): + channels() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + for( uint32_t i = 0; i < 18; i++){ + *(outbuffer + offset + 0) = (this->channels[i] >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->channels[i] >> (8 * 1)) & 0xFF; + offset += sizeof(this->channels[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + for( uint32_t i = 0; i < 18; i++){ + this->channels[i] = ((uint16_t) (*(inbuffer + offset))); + this->channels[i] |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->channels[i]); + } + return offset; + } + + virtual const char * getType() override { return "mavros_msgs/OverrideRCIn"; }; + virtual const char * getMD5() override { return "fd1e1c08fa504ec32737c41f45223398"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/Param.h b/pio_workspace/lib/ros_lib/mavros_msgs/Param.h new file mode 100644 index 0000000..01882aa --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/Param.h @@ -0,0 +1,85 @@ +#ifndef _ROS_mavros_msgs_Param_h +#define _ROS_mavros_msgs_Param_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "mavros_msgs/ParamValue.h" + +namespace mavros_msgs +{ + + class Param : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef const char* _param_id_type; + _param_id_type param_id; + typedef mavros_msgs::ParamValue _value_type; + _value_type value; + typedef uint16_t _param_index_type; + _param_index_type param_index; + typedef uint16_t _param_count_type; + _param_count_type param_count; + + Param(): + header(), + param_id(""), + value(), + param_index(0), + param_count(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_param_id = strlen(this->param_id); + varToArr(outbuffer + offset, length_param_id); + offset += 4; + memcpy(outbuffer + offset, this->param_id, length_param_id); + offset += length_param_id; + offset += this->value.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->param_index >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->param_index >> (8 * 1)) & 0xFF; + offset += sizeof(this->param_index); + *(outbuffer + offset + 0) = (this->param_count >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->param_count >> (8 * 1)) & 0xFF; + offset += sizeof(this->param_count); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_param_id; + arrToVar(length_param_id, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_param_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_param_id-1]=0; + this->param_id = (char *)(inbuffer + offset-1); + offset += length_param_id; + offset += this->value.deserialize(inbuffer + offset); + this->param_index = ((uint16_t) (*(inbuffer + offset))); + this->param_index |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->param_index); + this->param_count = ((uint16_t) (*(inbuffer + offset))); + this->param_count |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->param_count); + return offset; + } + + virtual const char * getType() override { return "mavros_msgs/Param"; }; + virtual const char * getMD5() override { return "62165a8f212050223dda9583b0f22c3c"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/ParamGet.h b/pio_workspace/lib/ros_lib/mavros_msgs/ParamGet.h new file mode 100644 index 0000000..57f6a85 --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/ParamGet.h @@ -0,0 +1,111 @@ +#ifndef _ROS_SERVICE_ParamGet_h +#define _ROS_SERVICE_ParamGet_h +#include +#include +#include +#include "ros/msg.h" +#include "mavros_msgs/ParamValue.h" + +namespace mavros_msgs +{ + +static const char PARAMGET[] = "mavros_msgs/ParamGet"; + + class ParamGetRequest : public ros::Msg + { + public: + typedef const char* _param_id_type; + _param_id_type param_id; + + ParamGetRequest(): + param_id("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_param_id = strlen(this->param_id); + varToArr(outbuffer + offset, length_param_id); + offset += 4; + memcpy(outbuffer + offset, this->param_id, length_param_id); + offset += length_param_id; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_param_id; + arrToVar(length_param_id, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_param_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_param_id-1]=0; + this->param_id = (char *)(inbuffer + offset-1); + offset += length_param_id; + return offset; + } + + virtual const char * getType() override { return PARAMGET; }; + virtual const char * getMD5() override { return "a0c8304d59f465712790120c3fc4b7d0"; }; + + }; + + class ParamGetResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + typedef mavros_msgs::ParamValue _value_type; + _value_type value; + + ParamGetResponse(): + success(0), + value() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + offset += this->value.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + offset += this->value.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return PARAMGET; }; + virtual const char * getMD5() override { return "790d22b22b9dbf32a8e8d55578e25477"; }; + + }; + + class ParamGet { + public: + typedef ParamGetRequest Request; + typedef ParamGetResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/ParamPull.h b/pio_workspace/lib/ros_lib/mavros_msgs/ParamPull.h new file mode 100644 index 0000000..5fe8251 --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/ParamPull.h @@ -0,0 +1,119 @@ +#ifndef _ROS_SERVICE_ParamPull_h +#define _ROS_SERVICE_ParamPull_h +#include +#include +#include +#include "ros/msg.h" + +namespace mavros_msgs +{ + +static const char PARAMPULL[] = "mavros_msgs/ParamPull"; + + class ParamPullRequest : public ros::Msg + { + public: + typedef bool _force_pull_type; + _force_pull_type force_pull; + + ParamPullRequest(): + force_pull(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_force_pull; + u_force_pull.real = this->force_pull; + *(outbuffer + offset + 0) = (u_force_pull.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->force_pull); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_force_pull; + u_force_pull.base = 0; + u_force_pull.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->force_pull = u_force_pull.real; + offset += sizeof(this->force_pull); + return offset; + } + + virtual const char * getType() override { return PARAMPULL; }; + virtual const char * getMD5() override { return "16415b4e049d3f92df764eeb461102b7"; }; + + }; + + class ParamPullResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + typedef uint32_t _param_received_type; + _param_received_type param_received; + + ParamPullResponse(): + success(0), + param_received(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + *(outbuffer + offset + 0) = (this->param_received >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->param_received >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->param_received >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->param_received >> (8 * 3)) & 0xFF; + offset += sizeof(this->param_received); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + this->param_received = ((uint32_t) (*(inbuffer + offset))); + this->param_received |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->param_received |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->param_received |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->param_received); + return offset; + } + + virtual const char * getType() override { return PARAMPULL; }; + virtual const char * getMD5() override { return "5601e883220b149a3209512e966299f0"; }; + + }; + + class ParamPull { + public: + typedef ParamPullRequest Request; + typedef ParamPullResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/ParamPush.h b/pio_workspace/lib/ros_lib/mavros_msgs/ParamPush.h new file mode 100644 index 0000000..3c390f4 --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/ParamPush.h @@ -0,0 +1,101 @@ +#ifndef _ROS_SERVICE_ParamPush_h +#define _ROS_SERVICE_ParamPush_h +#include +#include +#include +#include "ros/msg.h" + +namespace mavros_msgs +{ + +static const char PARAMPUSH[] = "mavros_msgs/ParamPush"; + + class ParamPushRequest : public ros::Msg + { + public: + + ParamPushRequest() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + return offset; + } + + virtual const char * getType() override { return PARAMPUSH; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class ParamPushResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + typedef uint32_t _param_transfered_type; + _param_transfered_type param_transfered; + + ParamPushResponse(): + success(0), + param_transfered(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + *(outbuffer + offset + 0) = (this->param_transfered >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->param_transfered >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->param_transfered >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->param_transfered >> (8 * 3)) & 0xFF; + offset += sizeof(this->param_transfered); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + this->param_transfered = ((uint32_t) (*(inbuffer + offset))); + this->param_transfered |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->param_transfered |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->param_transfered |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->param_transfered); + return offset; + } + + virtual const char * getType() override { return PARAMPUSH; }; + virtual const char * getMD5() override { return "d3fc4d8cefa193382985a92a041a2a3d"; }; + + }; + + class ParamPush { + public: + typedef ParamPushRequest Request; + typedef ParamPushResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/ParamSet.h b/pio_workspace/lib/ros_lib/mavros_msgs/ParamSet.h new file mode 100644 index 0000000..cb3115e --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/ParamSet.h @@ -0,0 +1,116 @@ +#ifndef _ROS_SERVICE_ParamSet_h +#define _ROS_SERVICE_ParamSet_h +#include +#include +#include +#include "ros/msg.h" +#include "mavros_msgs/ParamValue.h" + +namespace mavros_msgs +{ + +static const char PARAMSET[] = "mavros_msgs/ParamSet"; + + class ParamSetRequest : public ros::Msg + { + public: + typedef const char* _param_id_type; + _param_id_type param_id; + typedef mavros_msgs::ParamValue _value_type; + _value_type value; + + ParamSetRequest(): + param_id(""), + value() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_param_id = strlen(this->param_id); + varToArr(outbuffer + offset, length_param_id); + offset += 4; + memcpy(outbuffer + offset, this->param_id, length_param_id); + offset += length_param_id; + offset += this->value.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_param_id; + arrToVar(length_param_id, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_param_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_param_id-1]=0; + this->param_id = (char *)(inbuffer + offset-1); + offset += length_param_id; + offset += this->value.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return PARAMSET; }; + virtual const char * getMD5() override { return "4a17f346bc27984b348c799c674a04d9"; }; + + }; + + class ParamSetResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + typedef mavros_msgs::ParamValue _value_type; + _value_type value; + + ParamSetResponse(): + success(0), + value() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + offset += this->value.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + offset += this->value.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return PARAMSET; }; + virtual const char * getMD5() override { return "790d22b22b9dbf32a8e8d55578e25477"; }; + + }; + + class ParamSet { + public: + typedef ParamSetRequest Request; + typedef ParamSetResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/ParamValue.h b/pio_workspace/lib/ros_lib/mavros_msgs/ParamValue.h new file mode 100644 index 0000000..ddcab4a --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/ParamValue.h @@ -0,0 +1,75 @@ +#ifndef _ROS_mavros_msgs_ParamValue_h +#define _ROS_mavros_msgs_ParamValue_h + +#include +#include +#include +#include "ros/msg.h" + +namespace mavros_msgs +{ + + class ParamValue : public ros::Msg + { + public: + typedef int64_t _integer_type; + _integer_type integer; + typedef float _real_type; + _real_type real; + + ParamValue(): + integer(0), + real(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + int64_t real; + uint64_t base; + } u_integer; + u_integer.real = this->integer; + *(outbuffer + offset + 0) = (u_integer.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_integer.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_integer.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_integer.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_integer.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_integer.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_integer.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_integer.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->integer); + offset += serializeAvrFloat64(outbuffer + offset, this->real); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + int64_t real; + uint64_t base; + } u_integer; + u_integer.base = 0; + u_integer.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_integer.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_integer.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_integer.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_integer.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_integer.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_integer.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_integer.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->integer = u_integer.real; + offset += sizeof(this->integer); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->real)); + return offset; + } + + virtual const char * getType() override { return "mavros_msgs/ParamValue"; }; + virtual const char * getMD5() override { return "e2cb1c7a0f6ef0c62d450cd9362c980d"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/PlayTuneV2.h b/pio_workspace/lib/ros_lib/mavros_msgs/PlayTuneV2.h new file mode 100644 index 0000000..438e46e --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/PlayTuneV2.h @@ -0,0 +1,64 @@ +#ifndef _ROS_mavros_msgs_PlayTuneV2_h +#define _ROS_mavros_msgs_PlayTuneV2_h + +#include +#include +#include +#include "ros/msg.h" + +namespace mavros_msgs +{ + + class PlayTuneV2 : public ros::Msg + { + public: + typedef uint8_t _format_type; + _format_type format; + typedef const char* _tune_type; + _tune_type tune; + enum { QBASIC1_1 = 1 }; + enum { MML_MODERN = 2 }; + + PlayTuneV2(): + format(0), + tune("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->format >> (8 * 0)) & 0xFF; + offset += sizeof(this->format); + uint32_t length_tune = strlen(this->tune); + varToArr(outbuffer + offset, length_tune); + offset += 4; + memcpy(outbuffer + offset, this->tune, length_tune); + offset += length_tune; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->format = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->format); + uint32_t length_tune; + arrToVar(length_tune, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_tune; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_tune-1]=0; + this->tune = (char *)(inbuffer + offset-1); + offset += length_tune; + return offset; + } + + virtual const char * getType() override { return "mavros_msgs/PlayTuneV2"; }; + virtual const char * getMD5() override { return "177f99ce3572342a75a8b5cdefc8286e"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/PositionTarget.h b/pio_workspace/lib/ros_lib/mavros_msgs/PositionTarget.h new file mode 100644 index 0000000..12397df --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/PositionTarget.h @@ -0,0 +1,141 @@ +#ifndef _ROS_mavros_msgs_PositionTarget_h +#define _ROS_mavros_msgs_PositionTarget_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Point.h" +#include "geometry_msgs/Vector3.h" + +namespace mavros_msgs +{ + + class PositionTarget : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef uint8_t _coordinate_frame_type; + _coordinate_frame_type coordinate_frame; + typedef uint16_t _type_mask_type; + _type_mask_type type_mask; + typedef geometry_msgs::Point _position_type; + _position_type position; + typedef geometry_msgs::Vector3 _velocity_type; + _velocity_type velocity; + typedef geometry_msgs::Vector3 _acceleration_or_force_type; + _acceleration_or_force_type acceleration_or_force; + typedef float _yaw_type; + _yaw_type yaw; + typedef float _yaw_rate_type; + _yaw_rate_type yaw_rate; + enum { FRAME_LOCAL_NED = 1 }; + enum { FRAME_LOCAL_OFFSET_NED = 7 }; + enum { FRAME_BODY_NED = 8 }; + enum { FRAME_BODY_OFFSET_NED = 9 }; + enum { IGNORE_PX = 1 }; + enum { IGNORE_PY = 2 }; + enum { IGNORE_PZ = 4 }; + enum { IGNORE_VX = 8 }; + enum { IGNORE_VY = 16 }; + enum { IGNORE_VZ = 32 }; + enum { IGNORE_AFX = 64 }; + enum { IGNORE_AFY = 128 }; + enum { IGNORE_AFZ = 256 }; + enum { FORCE = 512 }; + enum { IGNORE_YAW = 1024 }; + enum { IGNORE_YAW_RATE = 2048 }; + + PositionTarget(): + header(), + coordinate_frame(0), + type_mask(0), + position(), + velocity(), + acceleration_or_force(), + yaw(0), + yaw_rate(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->coordinate_frame >> (8 * 0)) & 0xFF; + offset += sizeof(this->coordinate_frame); + *(outbuffer + offset + 0) = (this->type_mask >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->type_mask >> (8 * 1)) & 0xFF; + offset += sizeof(this->type_mask); + offset += this->position.serialize(outbuffer + offset); + offset += this->velocity.serialize(outbuffer + offset); + offset += this->acceleration_or_force.serialize(outbuffer + offset); + union { + float real; + uint32_t base; + } u_yaw; + u_yaw.real = this->yaw; + *(outbuffer + offset + 0) = (u_yaw.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_yaw.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_yaw.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_yaw.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->yaw); + union { + float real; + uint32_t base; + } u_yaw_rate; + u_yaw_rate.real = this->yaw_rate; + *(outbuffer + offset + 0) = (u_yaw_rate.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_yaw_rate.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_yaw_rate.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_yaw_rate.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->yaw_rate); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + this->coordinate_frame = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->coordinate_frame); + this->type_mask = ((uint16_t) (*(inbuffer + offset))); + this->type_mask |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->type_mask); + offset += this->position.deserialize(inbuffer + offset); + offset += this->velocity.deserialize(inbuffer + offset); + offset += this->acceleration_or_force.deserialize(inbuffer + offset); + union { + float real; + uint32_t base; + } u_yaw; + u_yaw.base = 0; + u_yaw.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_yaw.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_yaw.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_yaw.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->yaw = u_yaw.real; + offset += sizeof(this->yaw); + union { + float real; + uint32_t base; + } u_yaw_rate; + u_yaw_rate.base = 0; + u_yaw_rate.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_yaw_rate.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_yaw_rate.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_yaw_rate.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->yaw_rate = u_yaw_rate.real; + offset += sizeof(this->yaw_rate); + return offset; + } + + virtual const char * getType() override { return "mavros_msgs/PositionTarget"; }; + virtual const char * getMD5() override { return "dedb0081aaf8cb20209737746bb49117"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/RCIn.h b/pio_workspace/lib/ros_lib/mavros_msgs/RCIn.h new file mode 100644 index 0000000..88110e8 --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/RCIn.h @@ -0,0 +1,80 @@ +#ifndef _ROS_mavros_msgs_RCIn_h +#define _ROS_mavros_msgs_RCIn_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace mavros_msgs +{ + + class RCIn : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef uint8_t _rssi_type; + _rssi_type rssi; + uint32_t channels_length; + typedef uint16_t _channels_type; + _channels_type st_channels; + _channels_type * channels; + + RCIn(): + header(), + rssi(0), + channels_length(0), st_channels(), channels(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->rssi >> (8 * 0)) & 0xFF; + offset += sizeof(this->rssi); + *(outbuffer + offset + 0) = (this->channels_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->channels_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->channels_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->channels_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->channels_length); + for( uint32_t i = 0; i < channels_length; i++){ + *(outbuffer + offset + 0) = (this->channels[i] >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->channels[i] >> (8 * 1)) & 0xFF; + offset += sizeof(this->channels[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + this->rssi = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->rssi); + uint32_t channels_lengthT = ((uint32_t) (*(inbuffer + offset))); + channels_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + channels_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + channels_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->channels_length); + if(channels_lengthT > channels_length) + this->channels = (uint16_t*)realloc(this->channels, channels_lengthT * sizeof(uint16_t)); + channels_length = channels_lengthT; + for( uint32_t i = 0; i < channels_length; i++){ + this->st_channels = ((uint16_t) (*(inbuffer + offset))); + this->st_channels |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->st_channels); + memcpy( &(this->channels[i]), &(this->st_channels), sizeof(uint16_t)); + } + return offset; + } + + virtual const char * getType() override { return "mavros_msgs/RCIn"; }; + virtual const char * getMD5() override { return "1c3eafdb5efbcda3c334e1788bbcfe39"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/RCOut.h b/pio_workspace/lib/ros_lib/mavros_msgs/RCOut.h new file mode 100644 index 0000000..7744beb --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/RCOut.h @@ -0,0 +1,73 @@ +#ifndef _ROS_mavros_msgs_RCOut_h +#define _ROS_mavros_msgs_RCOut_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace mavros_msgs +{ + + class RCOut : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t channels_length; + typedef uint16_t _channels_type; + _channels_type st_channels; + _channels_type * channels; + + RCOut(): + header(), + channels_length(0), st_channels(), channels(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->channels_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->channels_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->channels_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->channels_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->channels_length); + for( uint32_t i = 0; i < channels_length; i++){ + *(outbuffer + offset + 0) = (this->channels[i] >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->channels[i] >> (8 * 1)) & 0xFF; + offset += sizeof(this->channels[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t channels_lengthT = ((uint32_t) (*(inbuffer + offset))); + channels_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + channels_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + channels_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->channels_length); + if(channels_lengthT > channels_length) + this->channels = (uint16_t*)realloc(this->channels, channels_lengthT * sizeof(uint16_t)); + channels_length = channels_lengthT; + for( uint32_t i = 0; i < channels_length; i++){ + this->st_channels = ((uint16_t) (*(inbuffer + offset))); + this->st_channels |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->st_channels); + memcpy( &(this->channels[i]), &(this->st_channels), sizeof(uint16_t)); + } + return offset; + } + + virtual const char * getType() override { return "mavros_msgs/RCOut"; }; + virtual const char * getMD5() override { return "52cacf104bab5ae3b103cfe176590713"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/RTCM.h b/pio_workspace/lib/ros_lib/mavros_msgs/RTCM.h new file mode 100644 index 0000000..69ad95a --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/RTCM.h @@ -0,0 +1,71 @@ +#ifndef _ROS_mavros_msgs_RTCM_h +#define _ROS_mavros_msgs_RTCM_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace mavros_msgs +{ + + class RTCM : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t data_length; + typedef uint8_t _data_type; + _data_type st_data; + _data_type * data; + + RTCM(): + header(), + data_length(0), st_data(), data(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->data_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->data_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->data_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->data_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->data_length); + for( uint32_t i = 0; i < data_length; i++){ + *(outbuffer + offset + 0) = (this->data[i] >> (8 * 0)) & 0xFF; + offset += sizeof(this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t data_lengthT = ((uint32_t) (*(inbuffer + offset))); + data_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + data_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + data_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->data_length); + if(data_lengthT > data_length) + this->data = (uint8_t*)realloc(this->data, data_lengthT * sizeof(uint8_t)); + data_length = data_lengthT; + for( uint32_t i = 0; i < data_length; i++){ + this->st_data = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(uint8_t)); + } + return offset; + } + + virtual const char * getType() override { return "mavros_msgs/RTCM"; }; + virtual const char * getMD5() override { return "8903b686ebe5db3477e83c6d0bb149f8"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/RTKBaseline.h b/pio_workspace/lib/ros_lib/mavros_msgs/RTKBaseline.h new file mode 100644 index 0000000..ec45d4b --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/RTKBaseline.h @@ -0,0 +1,225 @@ +#ifndef _ROS_mavros_msgs_RTKBaseline_h +#define _ROS_mavros_msgs_RTKBaseline_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace mavros_msgs +{ + + class RTKBaseline : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef uint32_t _time_last_baseline_ms_type; + _time_last_baseline_ms_type time_last_baseline_ms; + typedef uint8_t _rtk_receiver_id_type; + _rtk_receiver_id_type rtk_receiver_id; + typedef uint16_t _wn_type; + _wn_type wn; + typedef uint32_t _tow_type; + _tow_type tow; + typedef uint8_t _rtk_health_type; + _rtk_health_type rtk_health; + typedef uint8_t _rtk_rate_type; + _rtk_rate_type rtk_rate; + typedef uint8_t _nsats_type; + _nsats_type nsats; + typedef uint8_t _baseline_coords_type_type; + _baseline_coords_type_type baseline_coords_type; + typedef int32_t _baseline_a_mm_type; + _baseline_a_mm_type baseline_a_mm; + typedef int32_t _baseline_b_mm_type; + _baseline_b_mm_type baseline_b_mm; + typedef int32_t _baseline_c_mm_type; + _baseline_c_mm_type baseline_c_mm; + typedef uint32_t _accuracy_type; + _accuracy_type accuracy; + typedef int32_t _iar_num_hypotheses_type; + _iar_num_hypotheses_type iar_num_hypotheses; + enum { RTK_BASELINE_COORDINATE_SYSTEM_ECEF = 0 }; + enum { RTK_BASELINE_COORDINATE_SYSTEM_NED = 1 }; + + RTKBaseline(): + header(), + time_last_baseline_ms(0), + rtk_receiver_id(0), + wn(0), + tow(0), + rtk_health(0), + rtk_rate(0), + nsats(0), + baseline_coords_type(0), + baseline_a_mm(0), + baseline_b_mm(0), + baseline_c_mm(0), + accuracy(0), + iar_num_hypotheses(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->time_last_baseline_ms >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->time_last_baseline_ms >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->time_last_baseline_ms >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->time_last_baseline_ms >> (8 * 3)) & 0xFF; + offset += sizeof(this->time_last_baseline_ms); + *(outbuffer + offset + 0) = (this->rtk_receiver_id >> (8 * 0)) & 0xFF; + offset += sizeof(this->rtk_receiver_id); + *(outbuffer + offset + 0) = (this->wn >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->wn >> (8 * 1)) & 0xFF; + offset += sizeof(this->wn); + *(outbuffer + offset + 0) = (this->tow >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->tow >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->tow >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->tow >> (8 * 3)) & 0xFF; + offset += sizeof(this->tow); + *(outbuffer + offset + 0) = (this->rtk_health >> (8 * 0)) & 0xFF; + offset += sizeof(this->rtk_health); + *(outbuffer + offset + 0) = (this->rtk_rate >> (8 * 0)) & 0xFF; + offset += sizeof(this->rtk_rate); + *(outbuffer + offset + 0) = (this->nsats >> (8 * 0)) & 0xFF; + offset += sizeof(this->nsats); + *(outbuffer + offset + 0) = (this->baseline_coords_type >> (8 * 0)) & 0xFF; + offset += sizeof(this->baseline_coords_type); + union { + int32_t real; + uint32_t base; + } u_baseline_a_mm; + u_baseline_a_mm.real = this->baseline_a_mm; + *(outbuffer + offset + 0) = (u_baseline_a_mm.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_baseline_a_mm.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_baseline_a_mm.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_baseline_a_mm.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->baseline_a_mm); + union { + int32_t real; + uint32_t base; + } u_baseline_b_mm; + u_baseline_b_mm.real = this->baseline_b_mm; + *(outbuffer + offset + 0) = (u_baseline_b_mm.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_baseline_b_mm.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_baseline_b_mm.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_baseline_b_mm.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->baseline_b_mm); + union { + int32_t real; + uint32_t base; + } u_baseline_c_mm; + u_baseline_c_mm.real = this->baseline_c_mm; + *(outbuffer + offset + 0) = (u_baseline_c_mm.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_baseline_c_mm.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_baseline_c_mm.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_baseline_c_mm.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->baseline_c_mm); + *(outbuffer + offset + 0) = (this->accuracy >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->accuracy >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->accuracy >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->accuracy >> (8 * 3)) & 0xFF; + offset += sizeof(this->accuracy); + union { + int32_t real; + uint32_t base; + } u_iar_num_hypotheses; + u_iar_num_hypotheses.real = this->iar_num_hypotheses; + *(outbuffer + offset + 0) = (u_iar_num_hypotheses.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_iar_num_hypotheses.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_iar_num_hypotheses.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_iar_num_hypotheses.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->iar_num_hypotheses); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + this->time_last_baseline_ms = ((uint32_t) (*(inbuffer + offset))); + this->time_last_baseline_ms |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->time_last_baseline_ms |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->time_last_baseline_ms |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->time_last_baseline_ms); + this->rtk_receiver_id = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->rtk_receiver_id); + this->wn = ((uint16_t) (*(inbuffer + offset))); + this->wn |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->wn); + this->tow = ((uint32_t) (*(inbuffer + offset))); + this->tow |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->tow |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->tow |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->tow); + this->rtk_health = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->rtk_health); + this->rtk_rate = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->rtk_rate); + this->nsats = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->nsats); + this->baseline_coords_type = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->baseline_coords_type); + union { + int32_t real; + uint32_t base; + } u_baseline_a_mm; + u_baseline_a_mm.base = 0; + u_baseline_a_mm.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_baseline_a_mm.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_baseline_a_mm.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_baseline_a_mm.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->baseline_a_mm = u_baseline_a_mm.real; + offset += sizeof(this->baseline_a_mm); + union { + int32_t real; + uint32_t base; + } u_baseline_b_mm; + u_baseline_b_mm.base = 0; + u_baseline_b_mm.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_baseline_b_mm.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_baseline_b_mm.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_baseline_b_mm.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->baseline_b_mm = u_baseline_b_mm.real; + offset += sizeof(this->baseline_b_mm); + union { + int32_t real; + uint32_t base; + } u_baseline_c_mm; + u_baseline_c_mm.base = 0; + u_baseline_c_mm.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_baseline_c_mm.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_baseline_c_mm.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_baseline_c_mm.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->baseline_c_mm = u_baseline_c_mm.real; + offset += sizeof(this->baseline_c_mm); + this->accuracy = ((uint32_t) (*(inbuffer + offset))); + this->accuracy |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->accuracy |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->accuracy |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->accuracy); + union { + int32_t real; + uint32_t base; + } u_iar_num_hypotheses; + u_iar_num_hypotheses.base = 0; + u_iar_num_hypotheses.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_iar_num_hypotheses.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_iar_num_hypotheses.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_iar_num_hypotheses.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->iar_num_hypotheses = u_iar_num_hypotheses.real; + offset += sizeof(this->iar_num_hypotheses); + return offset; + } + + virtual const char * getType() override { return "mavros_msgs/RTKBaseline"; }; + virtual const char * getMD5() override { return "bd5852b76aa13136cec34a65089dfdb2"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/RadioStatus.h b/pio_workspace/lib/ros_lib/mavros_msgs/RadioStatus.h new file mode 100644 index 0000000..13df7c0 --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/RadioStatus.h @@ -0,0 +1,145 @@ +#ifndef _ROS_mavros_msgs_RadioStatus_h +#define _ROS_mavros_msgs_RadioStatus_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace mavros_msgs +{ + + class RadioStatus : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef uint8_t _rssi_type; + _rssi_type rssi; + typedef uint8_t _remrssi_type; + _remrssi_type remrssi; + typedef uint8_t _txbuf_type; + _txbuf_type txbuf; + typedef uint8_t _noise_type; + _noise_type noise; + typedef uint8_t _remnoise_type; + _remnoise_type remnoise; + typedef uint16_t _rxerrors_type; + _rxerrors_type rxerrors; + typedef uint16_t _fixed_type; + _fixed_type fixed; + typedef float _rssi_dbm_type; + _rssi_dbm_type rssi_dbm; + typedef float _remrssi_dbm_type; + _remrssi_dbm_type remrssi_dbm; + + RadioStatus(): + header(), + rssi(0), + remrssi(0), + txbuf(0), + noise(0), + remnoise(0), + rxerrors(0), + fixed(0), + rssi_dbm(0), + remrssi_dbm(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->rssi >> (8 * 0)) & 0xFF; + offset += sizeof(this->rssi); + *(outbuffer + offset + 0) = (this->remrssi >> (8 * 0)) & 0xFF; + offset += sizeof(this->remrssi); + *(outbuffer + offset + 0) = (this->txbuf >> (8 * 0)) & 0xFF; + offset += sizeof(this->txbuf); + *(outbuffer + offset + 0) = (this->noise >> (8 * 0)) & 0xFF; + offset += sizeof(this->noise); + *(outbuffer + offset + 0) = (this->remnoise >> (8 * 0)) & 0xFF; + offset += sizeof(this->remnoise); + *(outbuffer + offset + 0) = (this->rxerrors >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->rxerrors >> (8 * 1)) & 0xFF; + offset += sizeof(this->rxerrors); + *(outbuffer + offset + 0) = (this->fixed >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->fixed >> (8 * 1)) & 0xFF; + offset += sizeof(this->fixed); + union { + float real; + uint32_t base; + } u_rssi_dbm; + u_rssi_dbm.real = this->rssi_dbm; + *(outbuffer + offset + 0) = (u_rssi_dbm.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_rssi_dbm.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_rssi_dbm.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_rssi_dbm.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->rssi_dbm); + union { + float real; + uint32_t base; + } u_remrssi_dbm; + u_remrssi_dbm.real = this->remrssi_dbm; + *(outbuffer + offset + 0) = (u_remrssi_dbm.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_remrssi_dbm.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_remrssi_dbm.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_remrssi_dbm.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->remrssi_dbm); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + this->rssi = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->rssi); + this->remrssi = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->remrssi); + this->txbuf = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->txbuf); + this->noise = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->noise); + this->remnoise = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->remnoise); + this->rxerrors = ((uint16_t) (*(inbuffer + offset))); + this->rxerrors |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->rxerrors); + this->fixed = ((uint16_t) (*(inbuffer + offset))); + this->fixed |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->fixed); + union { + float real; + uint32_t base; + } u_rssi_dbm; + u_rssi_dbm.base = 0; + u_rssi_dbm.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_rssi_dbm.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_rssi_dbm.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_rssi_dbm.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->rssi_dbm = u_rssi_dbm.real; + offset += sizeof(this->rssi_dbm); + union { + float real; + uint32_t base; + } u_remrssi_dbm; + u_remrssi_dbm.base = 0; + u_remrssi_dbm.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_remrssi_dbm.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_remrssi_dbm.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_remrssi_dbm.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->remrssi_dbm = u_remrssi_dbm.real; + offset += sizeof(this->remrssi_dbm); + return offset; + } + + virtual const char * getType() override { return "mavros_msgs/RadioStatus"; }; + virtual const char * getMD5() override { return "04e4a879bb2687140da50a1a821e2190"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/SetMavFrame.h b/pio_workspace/lib/ros_lib/mavros_msgs/SetMavFrame.h new file mode 100644 index 0000000..b663053 --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/SetMavFrame.h @@ -0,0 +1,117 @@ +#ifndef _ROS_SERVICE_SetMavFrame_h +#define _ROS_SERVICE_SetMavFrame_h +#include +#include +#include +#include "ros/msg.h" + +namespace mavros_msgs +{ + +static const char SETMAVFRAME[] = "mavros_msgs/SetMavFrame"; + + class SetMavFrameRequest : public ros::Msg + { + public: + typedef uint8_t _mav_frame_type; + _mav_frame_type mav_frame; + enum { FRAME_GLOBAL = 0 }; + enum { FRAME_LOCAL_NED = 1 }; + enum { FRAME_MISSION = 2 }; + enum { FRAME_GLOBAL_RELATIVE_ALT = 3 }; + enum { FRAME_LOCAL_ENU = 4 }; + enum { FRAME_GLOBAL_INT = 5 }; + enum { FRAME_GLOBAL_RELATIVE_ALT_INT = 6 }; + enum { FRAME_LOCAL_OFFSET_NED = 7 }; + enum { FRAME_BODY_NED = 8 }; + enum { FRAME_BODY_OFFSET_NED = 9 }; + enum { FRAME_GLOBAL_TERRAIN_ALT = 10 }; + enum { FRAME_GLOBAL_TERRAIN_ALT_INT = 11 }; + enum { FRAME_BODY_FRD = 12 }; + enum { FRAME_RESERVED_13 = 13 }; + enum { FRAME_RESERVED_14 = 14 }; + enum { FRAME_RESERVED_15 = 15 }; + enum { FRAME_RESERVED_16 = 16 }; + enum { FRAME_RESERVED_17 = 17 }; + enum { FRAME_RESERVED_18 = 18 }; + enum { FRAME_RESERVED_19 = 19 }; + enum { FRAME_LOCAL_FRD = 20 }; + enum { FRAME_LOCAL_FLU = 21 }; + + SetMavFrameRequest(): + mav_frame(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->mav_frame >> (8 * 0)) & 0xFF; + offset += sizeof(this->mav_frame); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->mav_frame = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->mav_frame); + return offset; + } + + virtual const char * getType() override { return SETMAVFRAME; }; + virtual const char * getMD5() override { return "10d9e03dcd8d648e58b34bad2a28091f"; }; + + }; + + class SetMavFrameResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + + SetMavFrameResponse(): + success(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + return offset; + } + + virtual const char * getType() override { return SETMAVFRAME; }; + virtual const char * getMD5() override { return "358e233cde0c8a8bcfea4ce193f8fc15"; }; + + }; + + class SetMavFrame { + public: + typedef SetMavFrameRequest Request; + typedef SetMavFrameResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/SetMode.h b/pio_workspace/lib/ros_lib/mavros_msgs/SetMode.h new file mode 100644 index 0000000..a9cc53b --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/SetMode.h @@ -0,0 +1,123 @@ +#ifndef _ROS_SERVICE_SetMode_h +#define _ROS_SERVICE_SetMode_h +#include +#include +#include +#include "ros/msg.h" + +namespace mavros_msgs +{ + +static const char SETMODE[] = "mavros_msgs/SetMode"; + + class SetModeRequest : public ros::Msg + { + public: + typedef uint8_t _base_mode_type; + _base_mode_type base_mode; + typedef const char* _custom_mode_type; + _custom_mode_type custom_mode; + enum { MAV_MODE_PREFLIGHT = 0 }; + enum { MAV_MODE_STABILIZE_DISARMED = 80 }; + enum { MAV_MODE_STABILIZE_ARMED = 208 }; + enum { MAV_MODE_MANUAL_DISARMED = 64 }; + enum { MAV_MODE_MANUAL_ARMED = 192 }; + enum { MAV_MODE_GUIDED_DISARMED = 88 }; + enum { MAV_MODE_GUIDED_ARMED = 216 }; + enum { MAV_MODE_AUTO_DISARMED = 92 }; + enum { MAV_MODE_AUTO_ARMED = 220 }; + enum { MAV_MODE_TEST_DISARMED = 66 }; + enum { MAV_MODE_TEST_ARMED = 194 }; + + SetModeRequest(): + base_mode(0), + custom_mode("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->base_mode >> (8 * 0)) & 0xFF; + offset += sizeof(this->base_mode); + uint32_t length_custom_mode = strlen(this->custom_mode); + varToArr(outbuffer + offset, length_custom_mode); + offset += 4; + memcpy(outbuffer + offset, this->custom_mode, length_custom_mode); + offset += length_custom_mode; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->base_mode = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->base_mode); + uint32_t length_custom_mode; + arrToVar(length_custom_mode, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_custom_mode; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_custom_mode-1]=0; + this->custom_mode = (char *)(inbuffer + offset-1); + offset += length_custom_mode; + return offset; + } + + virtual const char * getType() override { return SETMODE; }; + virtual const char * getMD5() override { return "d770431847cad3a8f50a81ec70ddf0e2"; }; + + }; + + class SetModeResponse : public ros::Msg + { + public: + typedef bool _mode_sent_type; + _mode_sent_type mode_sent; + + SetModeResponse(): + mode_sent(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_mode_sent; + u_mode_sent.real = this->mode_sent; + *(outbuffer + offset + 0) = (u_mode_sent.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->mode_sent); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_mode_sent; + u_mode_sent.base = 0; + u_mode_sent.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->mode_sent = u_mode_sent.real; + offset += sizeof(this->mode_sent); + return offset; + } + + virtual const char * getType() override { return SETMODE; }; + virtual const char * getMD5() override { return "a70bfe6329ecf8f8d858daa6f3db7655"; }; + + }; + + class SetMode { + public: + typedef SetModeRequest Request; + typedef SetModeResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/State.h b/pio_workspace/lib/ros_lib/mavros_msgs/State.h new file mode 100644 index 0000000..5cd4ebf --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/State.h @@ -0,0 +1,202 @@ +#ifndef _ROS_mavros_msgs_State_h +#define _ROS_mavros_msgs_State_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace mavros_msgs +{ + + class State : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef bool _connected_type; + _connected_type connected; + typedef bool _armed_type; + _armed_type armed; + typedef bool _guided_type; + _guided_type guided; + typedef bool _manual_input_type; + _manual_input_type manual_input; + typedef const char* _mode_type; + _mode_type mode; + typedef uint8_t _system_status_type; + _system_status_type system_status; + enum { MODE_APM_PLANE_MANUAL = MANUAL }; + enum { MODE_APM_PLANE_CIRCLE = CIRCLE }; + enum { MODE_APM_PLANE_STABILIZE = STABILIZE }; + enum { MODE_APM_PLANE_TRAINING = TRAINING }; + enum { MODE_APM_PLANE_ACRO = ACRO }; + enum { MODE_APM_PLANE_FBWA = FBWA }; + enum { MODE_APM_PLANE_FBWB = FBWB }; + enum { MODE_APM_PLANE_CRUISE = CRUISE }; + enum { MODE_APM_PLANE_AUTOTUNE = AUTOTUNE }; + enum { MODE_APM_PLANE_AUTO = AUTO }; + enum { MODE_APM_PLANE_RTL = RTL }; + enum { MODE_APM_PLANE_LOITER = LOITER }; + enum { MODE_APM_PLANE_LAND = LAND }; + enum { MODE_APM_PLANE_GUIDED = GUIDED }; + enum { MODE_APM_PLANE_INITIALISING = INITIALISING }; + enum { MODE_APM_PLANE_QSTABILIZE = QSTABILIZE }; + enum { MODE_APM_PLANE_QHOVER = QHOVER }; + enum { MODE_APM_PLANE_QLOITER = QLOITER }; + enum { MODE_APM_PLANE_QLAND = QLAND }; + enum { MODE_APM_PLANE_QRTL = QRTL }; + enum { MODE_APM_COPTER_STABILIZE = STABILIZE }; + enum { MODE_APM_COPTER_ACRO = ACRO }; + enum { MODE_APM_COPTER_ALT_HOLD = ALT_HOLD }; + enum { MODE_APM_COPTER_AUTO = AUTO }; + enum { MODE_APM_COPTER_GUIDED = GUIDED }; + enum { MODE_APM_COPTER_LOITER = LOITER }; + enum { MODE_APM_COPTER_RTL = RTL }; + enum { MODE_APM_COPTER_CIRCLE = CIRCLE }; + enum { MODE_APM_COPTER_POSITION = POSITION }; + enum { MODE_APM_COPTER_LAND = LAND }; + enum { MODE_APM_COPTER_OF_LOITER = OF_LOITER }; + enum { MODE_APM_COPTER_DRIFT = DRIFT }; + enum { MODE_APM_COPTER_SPORT = SPORT }; + enum { MODE_APM_COPTER_FLIP = FLIP }; + enum { MODE_APM_COPTER_AUTOTUNE = AUTOTUNE }; + enum { MODE_APM_COPTER_POSHOLD = POSHOLD }; + enum { MODE_APM_COPTER_BRAKE = BRAKE }; + enum { MODE_APM_COPTER_THROW = THROW }; + enum { MODE_APM_COPTER_AVOID_ADSB = AVOID_ADSB }; + enum { MODE_APM_COPTER_GUIDED_NOGPS = GUIDED_NOGPS }; + enum { MODE_APM_ROVER_MANUAL = MANUAL }; + enum { MODE_APM_ROVER_LEARNING = LEARNING }; + enum { MODE_APM_ROVER_STEERING = STEERING }; + enum { MODE_APM_ROVER_HOLD = HOLD }; + enum { MODE_APM_ROVER_AUTO = AUTO }; + enum { MODE_APM_ROVER_RTL = RTL }; + enum { MODE_APM_ROVER_GUIDED = GUIDED }; + enum { MODE_APM_ROVER_INITIALISING = INITIALISING }; + enum { MODE_PX4_MANUAL = MANUAL }; + enum { MODE_PX4_ACRO = ACRO }; + enum { MODE_PX4_ALTITUDE = ALTCTL }; + enum { MODE_PX4_POSITION = POSCTL }; + enum { MODE_PX4_OFFBOARD = OFFBOARD }; + enum { MODE_PX4_STABILIZED = STABILIZED }; + enum { MODE_PX4_RATTITUDE = RATTITUDE }; + enum { MODE_PX4_MISSION = AUTO.MISSION }; + enum { MODE_PX4_LOITER = AUTO.LOITER }; + enum { MODE_PX4_RTL = AUTO.RTL }; + enum { MODE_PX4_LAND = AUTO.LAND }; + enum { MODE_PX4_RTGS = AUTO.RTGS }; + enum { MODE_PX4_READY = AUTO.READY }; + enum { MODE_PX4_TAKEOFF = AUTO.TAKEOFF }; + + State(): + header(), + connected(0), + armed(0), + guided(0), + manual_input(0), + mode(""), + system_status(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + union { + bool real; + uint8_t base; + } u_connected; + u_connected.real = this->connected; + *(outbuffer + offset + 0) = (u_connected.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->connected); + union { + bool real; + uint8_t base; + } u_armed; + u_armed.real = this->armed; + *(outbuffer + offset + 0) = (u_armed.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->armed); + union { + bool real; + uint8_t base; + } u_guided; + u_guided.real = this->guided; + *(outbuffer + offset + 0) = (u_guided.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->guided); + union { + bool real; + uint8_t base; + } u_manual_input; + u_manual_input.real = this->manual_input; + *(outbuffer + offset + 0) = (u_manual_input.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->manual_input); + uint32_t length_mode = strlen(this->mode); + varToArr(outbuffer + offset, length_mode); + offset += 4; + memcpy(outbuffer + offset, this->mode, length_mode); + offset += length_mode; + *(outbuffer + offset + 0) = (this->system_status >> (8 * 0)) & 0xFF; + offset += sizeof(this->system_status); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + union { + bool real; + uint8_t base; + } u_connected; + u_connected.base = 0; + u_connected.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->connected = u_connected.real; + offset += sizeof(this->connected); + union { + bool real; + uint8_t base; + } u_armed; + u_armed.base = 0; + u_armed.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->armed = u_armed.real; + offset += sizeof(this->armed); + union { + bool real; + uint8_t base; + } u_guided; + u_guided.base = 0; + u_guided.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->guided = u_guided.real; + offset += sizeof(this->guided); + union { + bool real; + uint8_t base; + } u_manual_input; + u_manual_input.base = 0; + u_manual_input.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->manual_input = u_manual_input.real; + offset += sizeof(this->manual_input); + uint32_t length_mode; + arrToVar(length_mode, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_mode; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_mode-1]=0; + this->mode = (char *)(inbuffer + offset-1); + offset += length_mode; + this->system_status = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->system_status); + return offset; + } + + virtual const char * getType() override { return "mavros_msgs/State"; }; + virtual const char * getMD5() override { return "65cd0a9fff993b062b91e354554ec7e9"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/StatusText.h b/pio_workspace/lib/ros_lib/mavros_msgs/StatusText.h new file mode 100644 index 0000000..35b4413 --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/StatusText.h @@ -0,0 +1,76 @@ +#ifndef _ROS_mavros_msgs_StatusText_h +#define _ROS_mavros_msgs_StatusText_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace mavros_msgs +{ + + class StatusText : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef uint8_t _severity_type; + _severity_type severity; + typedef const char* _text_type; + _text_type text; + enum { EMERGENCY = 0 }; + enum { ALERT = 1 }; + enum { CRITICAL = 2 }; + enum { ERROR = 3 }; + enum { WARNING = 4 }; + enum { NOTICE = 5 }; + enum { INFO = 6 }; + enum { DEBUG = 7 }; + + StatusText(): + header(), + severity(0), + text("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->severity >> (8 * 0)) & 0xFF; + offset += sizeof(this->severity); + uint32_t length_text = strlen(this->text); + varToArr(outbuffer + offset, length_text); + offset += 4; + memcpy(outbuffer + offset, this->text, length_text); + offset += length_text; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + this->severity = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->severity); + uint32_t length_text; + arrToVar(length_text, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_text; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_text-1]=0; + this->text = (char *)(inbuffer + offset-1); + offset += length_text; + return offset; + } + + virtual const char * getType() override { return "mavros_msgs/StatusText"; }; + virtual const char * getMD5() override { return "6cfd33cd09e4abf5841d7be3c770a969"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/StreamRate.h b/pio_workspace/lib/ros_lib/mavros_msgs/StreamRate.h new file mode 100644 index 0000000..492b313 --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/StreamRate.h @@ -0,0 +1,113 @@ +#ifndef _ROS_SERVICE_StreamRate_h +#define _ROS_SERVICE_StreamRate_h +#include +#include +#include +#include "ros/msg.h" + +namespace mavros_msgs +{ + +static const char STREAMRATE[] = "mavros_msgs/StreamRate"; + + class StreamRateRequest : public ros::Msg + { + public: + typedef uint8_t _stream_id_type; + _stream_id_type stream_id; + typedef uint16_t _message_rate_type; + _message_rate_type message_rate; + typedef bool _on_off_type; + _on_off_type on_off; + enum { STREAM_ALL = 0 }; + enum { STREAM_RAW_SENSORS = 1 }; + enum { STREAM_EXTENDED_STATUS = 2 }; + enum { STREAM_RC_CHANNELS = 3 }; + enum { STREAM_RAW_CONTROLLER = 4 }; + enum { STREAM_POSITION = 6 }; + enum { STREAM_EXTRA1 = 10 }; + enum { STREAM_EXTRA2 = 11 }; + enum { STREAM_EXTRA3 = 12 }; + + StreamRateRequest(): + stream_id(0), + message_rate(0), + on_off(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->stream_id >> (8 * 0)) & 0xFF; + offset += sizeof(this->stream_id); + *(outbuffer + offset + 0) = (this->message_rate >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->message_rate >> (8 * 1)) & 0xFF; + offset += sizeof(this->message_rate); + union { + bool real; + uint8_t base; + } u_on_off; + u_on_off.real = this->on_off; + *(outbuffer + offset + 0) = (u_on_off.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->on_off); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->stream_id = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->stream_id); + this->message_rate = ((uint16_t) (*(inbuffer + offset))); + this->message_rate |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->message_rate); + union { + bool real; + uint8_t base; + } u_on_off; + u_on_off.base = 0; + u_on_off.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->on_off = u_on_off.real; + offset += sizeof(this->on_off); + return offset; + } + + virtual const char * getType() override { return STREAMRATE; }; + virtual const char * getMD5() override { return "d12f7661724c8ba25f67ba597bb7d039"; }; + + }; + + class StreamRateResponse : public ros::Msg + { + public: + + StreamRateResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + return offset; + } + + virtual const char * getType() override { return STREAMRATE; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class StreamRate { + public: + typedef StreamRateRequest Request; + typedef StreamRateResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/SysStatus.h b/pio_workspace/lib/ros_lib/mavros_msgs/SysStatus.h new file mode 100644 index 0000000..005df5f --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/SysStatus.h @@ -0,0 +1,193 @@ +#ifndef _ROS_mavros_msgs_SysStatus_h +#define _ROS_mavros_msgs_SysStatus_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace mavros_msgs +{ + + class SysStatus : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef uint32_t _sensors_present_type; + _sensors_present_type sensors_present; + typedef uint32_t _sensors_enabled_type; + _sensors_enabled_type sensors_enabled; + typedef uint32_t _sensors_health_type; + _sensors_health_type sensors_health; + typedef uint16_t _load_type; + _load_type load; + typedef uint16_t _voltage_battery_type; + _voltage_battery_type voltage_battery; + typedef int16_t _current_battery_type; + _current_battery_type current_battery; + typedef int8_t _battery_remaining_type; + _battery_remaining_type battery_remaining; + typedef uint16_t _drop_rate_comm_type; + _drop_rate_comm_type drop_rate_comm; + typedef uint16_t _errors_comm_type; + _errors_comm_type errors_comm; + typedef uint16_t _errors_count1_type; + _errors_count1_type errors_count1; + typedef uint16_t _errors_count2_type; + _errors_count2_type errors_count2; + typedef uint16_t _errors_count3_type; + _errors_count3_type errors_count3; + typedef uint16_t _errors_count4_type; + _errors_count4_type errors_count4; + + SysStatus(): + header(), + sensors_present(0), + sensors_enabled(0), + sensors_health(0), + load(0), + voltage_battery(0), + current_battery(0), + battery_remaining(0), + drop_rate_comm(0), + errors_comm(0), + errors_count1(0), + errors_count2(0), + errors_count3(0), + errors_count4(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->sensors_present >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->sensors_present >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->sensors_present >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->sensors_present >> (8 * 3)) & 0xFF; + offset += sizeof(this->sensors_present); + *(outbuffer + offset + 0) = (this->sensors_enabled >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->sensors_enabled >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->sensors_enabled >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->sensors_enabled >> (8 * 3)) & 0xFF; + offset += sizeof(this->sensors_enabled); + *(outbuffer + offset + 0) = (this->sensors_health >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->sensors_health >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->sensors_health >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->sensors_health >> (8 * 3)) & 0xFF; + offset += sizeof(this->sensors_health); + *(outbuffer + offset + 0) = (this->load >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->load >> (8 * 1)) & 0xFF; + offset += sizeof(this->load); + *(outbuffer + offset + 0) = (this->voltage_battery >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->voltage_battery >> (8 * 1)) & 0xFF; + offset += sizeof(this->voltage_battery); + union { + int16_t real; + uint16_t base; + } u_current_battery; + u_current_battery.real = this->current_battery; + *(outbuffer + offset + 0) = (u_current_battery.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_current_battery.base >> (8 * 1)) & 0xFF; + offset += sizeof(this->current_battery); + union { + int8_t real; + uint8_t base; + } u_battery_remaining; + u_battery_remaining.real = this->battery_remaining; + *(outbuffer + offset + 0) = (u_battery_remaining.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->battery_remaining); + *(outbuffer + offset + 0) = (this->drop_rate_comm >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->drop_rate_comm >> (8 * 1)) & 0xFF; + offset += sizeof(this->drop_rate_comm); + *(outbuffer + offset + 0) = (this->errors_comm >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->errors_comm >> (8 * 1)) & 0xFF; + offset += sizeof(this->errors_comm); + *(outbuffer + offset + 0) = (this->errors_count1 >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->errors_count1 >> (8 * 1)) & 0xFF; + offset += sizeof(this->errors_count1); + *(outbuffer + offset + 0) = (this->errors_count2 >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->errors_count2 >> (8 * 1)) & 0xFF; + offset += sizeof(this->errors_count2); + *(outbuffer + offset + 0) = (this->errors_count3 >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->errors_count3 >> (8 * 1)) & 0xFF; + offset += sizeof(this->errors_count3); + *(outbuffer + offset + 0) = (this->errors_count4 >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->errors_count4 >> (8 * 1)) & 0xFF; + offset += sizeof(this->errors_count4); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + this->sensors_present = ((uint32_t) (*(inbuffer + offset))); + this->sensors_present |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->sensors_present |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->sensors_present |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->sensors_present); + this->sensors_enabled = ((uint32_t) (*(inbuffer + offset))); + this->sensors_enabled |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->sensors_enabled |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->sensors_enabled |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->sensors_enabled); + this->sensors_health = ((uint32_t) (*(inbuffer + offset))); + this->sensors_health |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->sensors_health |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->sensors_health |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->sensors_health); + this->load = ((uint16_t) (*(inbuffer + offset))); + this->load |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->load); + this->voltage_battery = ((uint16_t) (*(inbuffer + offset))); + this->voltage_battery |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->voltage_battery); + union { + int16_t real; + uint16_t base; + } u_current_battery; + u_current_battery.base = 0; + u_current_battery.base |= ((uint16_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_current_battery.base |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->current_battery = u_current_battery.real; + offset += sizeof(this->current_battery); + union { + int8_t real; + uint8_t base; + } u_battery_remaining; + u_battery_remaining.base = 0; + u_battery_remaining.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->battery_remaining = u_battery_remaining.real; + offset += sizeof(this->battery_remaining); + this->drop_rate_comm = ((uint16_t) (*(inbuffer + offset))); + this->drop_rate_comm |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->drop_rate_comm); + this->errors_comm = ((uint16_t) (*(inbuffer + offset))); + this->errors_comm |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->errors_comm); + this->errors_count1 = ((uint16_t) (*(inbuffer + offset))); + this->errors_count1 |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->errors_count1); + this->errors_count2 = ((uint16_t) (*(inbuffer + offset))); + this->errors_count2 |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->errors_count2); + this->errors_count3 = ((uint16_t) (*(inbuffer + offset))); + this->errors_count3 |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->errors_count3); + this->errors_count4 = ((uint16_t) (*(inbuffer + offset))); + this->errors_count4 |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->errors_count4); + return offset; + } + + virtual const char * getType() override { return "mavros_msgs/SysStatus"; }; + virtual const char * getMD5() override { return "4039be26d76b32d20c569c754da6e25c"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/TerrainReport.h b/pio_workspace/lib/ros_lib/mavros_msgs/TerrainReport.h new file mode 100644 index 0000000..92e5e96 --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/TerrainReport.h @@ -0,0 +1,129 @@ +#ifndef _ROS_mavros_msgs_TerrainReport_h +#define _ROS_mavros_msgs_TerrainReport_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace mavros_msgs +{ + + class TerrainReport : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef float _latitude_type; + _latitude_type latitude; + typedef float _longitude_type; + _longitude_type longitude; + typedef uint16_t _spacing_type; + _spacing_type spacing; + typedef float _terrain_height_type; + _terrain_height_type terrain_height; + typedef float _current_height_type; + _current_height_type current_height; + typedef uint16_t _pending_type; + _pending_type pending; + typedef uint16_t _loaded_type; + _loaded_type loaded; + + TerrainReport(): + header(), + latitude(0), + longitude(0), + spacing(0), + terrain_height(0), + current_height(0), + pending(0), + loaded(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += serializeAvrFloat64(outbuffer + offset, this->latitude); + offset += serializeAvrFloat64(outbuffer + offset, this->longitude); + *(outbuffer + offset + 0) = (this->spacing >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->spacing >> (8 * 1)) & 0xFF; + offset += sizeof(this->spacing); + union { + float real; + uint32_t base; + } u_terrain_height; + u_terrain_height.real = this->terrain_height; + *(outbuffer + offset + 0) = (u_terrain_height.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_terrain_height.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_terrain_height.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_terrain_height.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->terrain_height); + union { + float real; + uint32_t base; + } u_current_height; + u_current_height.real = this->current_height; + *(outbuffer + offset + 0) = (u_current_height.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_current_height.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_current_height.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_current_height.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->current_height); + *(outbuffer + offset + 0) = (this->pending >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->pending >> (8 * 1)) & 0xFF; + offset += sizeof(this->pending); + *(outbuffer + offset + 0) = (this->loaded >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->loaded >> (8 * 1)) & 0xFF; + offset += sizeof(this->loaded); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->latitude)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->longitude)); + this->spacing = ((uint16_t) (*(inbuffer + offset))); + this->spacing |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->spacing); + union { + float real; + uint32_t base; + } u_terrain_height; + u_terrain_height.base = 0; + u_terrain_height.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_terrain_height.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_terrain_height.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_terrain_height.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->terrain_height = u_terrain_height.real; + offset += sizeof(this->terrain_height); + union { + float real; + uint32_t base; + } u_current_height; + u_current_height.base = 0; + u_current_height.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_current_height.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_current_height.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_current_height.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->current_height = u_current_height.real; + offset += sizeof(this->current_height); + this->pending = ((uint16_t) (*(inbuffer + offset))); + this->pending |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->pending); + this->loaded = ((uint16_t) (*(inbuffer + offset))); + this->loaded |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->loaded); + return offset; + } + + virtual const char * getType() override { return "mavros_msgs/TerrainReport"; }; + virtual const char * getMD5() override { return "f658be3a775aa38d678b427733ae0139"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/Thrust.h b/pio_workspace/lib/ros_lib/mavros_msgs/Thrust.h new file mode 100644 index 0000000..dd29b12 --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/Thrust.h @@ -0,0 +1,68 @@ +#ifndef _ROS_mavros_msgs_Thrust_h +#define _ROS_mavros_msgs_Thrust_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace mavros_msgs +{ + + class Thrust : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef float _thrust_type; + _thrust_type thrust; + + Thrust(): + header(), + thrust(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + union { + float real; + uint32_t base; + } u_thrust; + u_thrust.real = this->thrust; + *(outbuffer + offset + 0) = (u_thrust.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_thrust.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_thrust.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_thrust.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->thrust); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + union { + float real; + uint32_t base; + } u_thrust; + u_thrust.base = 0; + u_thrust.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_thrust.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_thrust.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_thrust.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->thrust = u_thrust.real; + offset += sizeof(this->thrust); + return offset; + } + + virtual const char * getType() override { return "mavros_msgs/Thrust"; }; + virtual const char * getMD5() override { return "c61da3a8868a8b502eaf0b0abd839f57"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/TimesyncStatus.h b/pio_workspace/lib/ros_lib/mavros_msgs/TimesyncStatus.h new file mode 100644 index 0000000..caed174 --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/TimesyncStatus.h @@ -0,0 +1,153 @@ +#ifndef _ROS_mavros_msgs_TimesyncStatus_h +#define _ROS_mavros_msgs_TimesyncStatus_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace mavros_msgs +{ + + class TimesyncStatus : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef uint64_t _remote_timestamp_ns_type; + _remote_timestamp_ns_type remote_timestamp_ns; + typedef int64_t _observed_offset_ns_type; + _observed_offset_ns_type observed_offset_ns; + typedef int64_t _estimated_offset_ns_type; + _estimated_offset_ns_type estimated_offset_ns; + typedef float _round_trip_time_ms_type; + _round_trip_time_ms_type round_trip_time_ms; + + TimesyncStatus(): + header(), + remote_timestamp_ns(0), + observed_offset_ns(0), + estimated_offset_ns(0), + round_trip_time_ms(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->remote_timestamp_ns >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->remote_timestamp_ns >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->remote_timestamp_ns >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->remote_timestamp_ns >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (this->remote_timestamp_ns >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (this->remote_timestamp_ns >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (this->remote_timestamp_ns >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (this->remote_timestamp_ns >> (8 * 7)) & 0xFF; + offset += sizeof(this->remote_timestamp_ns); + union { + int64_t real; + uint64_t base; + } u_observed_offset_ns; + u_observed_offset_ns.real = this->observed_offset_ns; + *(outbuffer + offset + 0) = (u_observed_offset_ns.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_observed_offset_ns.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_observed_offset_ns.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_observed_offset_ns.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_observed_offset_ns.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_observed_offset_ns.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_observed_offset_ns.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_observed_offset_ns.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->observed_offset_ns); + union { + int64_t real; + uint64_t base; + } u_estimated_offset_ns; + u_estimated_offset_ns.real = this->estimated_offset_ns; + *(outbuffer + offset + 0) = (u_estimated_offset_ns.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_estimated_offset_ns.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_estimated_offset_ns.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_estimated_offset_ns.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_estimated_offset_ns.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_estimated_offset_ns.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_estimated_offset_ns.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_estimated_offset_ns.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->estimated_offset_ns); + union { + float real; + uint32_t base; + } u_round_trip_time_ms; + u_round_trip_time_ms.real = this->round_trip_time_ms; + *(outbuffer + offset + 0) = (u_round_trip_time_ms.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_round_trip_time_ms.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_round_trip_time_ms.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_round_trip_time_ms.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->round_trip_time_ms); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + this->remote_timestamp_ns = ((uint64_t) (*(inbuffer + offset))); + this->remote_timestamp_ns |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->remote_timestamp_ns |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->remote_timestamp_ns |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->remote_timestamp_ns |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + this->remote_timestamp_ns |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + this->remote_timestamp_ns |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + this->remote_timestamp_ns |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + offset += sizeof(this->remote_timestamp_ns); + union { + int64_t real; + uint64_t base; + } u_observed_offset_ns; + u_observed_offset_ns.base = 0; + u_observed_offset_ns.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_observed_offset_ns.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_observed_offset_ns.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_observed_offset_ns.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_observed_offset_ns.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_observed_offset_ns.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_observed_offset_ns.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_observed_offset_ns.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->observed_offset_ns = u_observed_offset_ns.real; + offset += sizeof(this->observed_offset_ns); + union { + int64_t real; + uint64_t base; + } u_estimated_offset_ns; + u_estimated_offset_ns.base = 0; + u_estimated_offset_ns.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_estimated_offset_ns.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_estimated_offset_ns.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_estimated_offset_ns.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_estimated_offset_ns.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_estimated_offset_ns.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_estimated_offset_ns.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_estimated_offset_ns.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->estimated_offset_ns = u_estimated_offset_ns.real; + offset += sizeof(this->estimated_offset_ns); + union { + float real; + uint32_t base; + } u_round_trip_time_ms; + u_round_trip_time_ms.base = 0; + u_round_trip_time_ms.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_round_trip_time_ms.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_round_trip_time_ms.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_round_trip_time_ms.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->round_trip_time_ms = u_round_trip_time_ms.real; + offset += sizeof(this->round_trip_time_ms); + return offset; + } + + virtual const char * getType() override { return "mavros_msgs/TimesyncStatus"; }; + virtual const char * getMD5() override { return "021ec8044e747bea518b441f374ba64b"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/Trajectory.h b/pio_workspace/lib/ros_lib/mavros_msgs/Trajectory.h new file mode 100644 index 0000000..f6df789 --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/Trajectory.h @@ -0,0 +1,128 @@ +#ifndef _ROS_mavros_msgs_Trajectory_h +#define _ROS_mavros_msgs_Trajectory_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "mavros_msgs/PositionTarget.h" + +namespace mavros_msgs +{ + + class Trajectory : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef uint8_t _type_type; + _type_type type; + typedef mavros_msgs::PositionTarget _point_1_type; + _point_1_type point_1; + typedef mavros_msgs::PositionTarget _point_2_type; + _point_2_type point_2; + typedef mavros_msgs::PositionTarget _point_3_type; + _point_3_type point_3; + typedef mavros_msgs::PositionTarget _point_4_type; + _point_4_type point_4; + typedef mavros_msgs::PositionTarget _point_5_type; + _point_5_type point_5; + uint8_t point_valid[5]; + uint16_t command[5]; + float time_horizon[5]; + enum { MAV_TRAJECTORY_REPRESENTATION_WAYPOINTS = 0 }; + enum { MAV_TRAJECTORY_REPRESENTATION_BEZIER = 1 }; + + Trajectory(): + header(), + type(0), + point_1(), + point_2(), + point_3(), + point_4(), + point_5(), + point_valid(), + command(), + time_horizon() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->type >> (8 * 0)) & 0xFF; + offset += sizeof(this->type); + offset += this->point_1.serialize(outbuffer + offset); + offset += this->point_2.serialize(outbuffer + offset); + offset += this->point_3.serialize(outbuffer + offset); + offset += this->point_4.serialize(outbuffer + offset); + offset += this->point_5.serialize(outbuffer + offset); + for( uint32_t i = 0; i < 5; i++){ + *(outbuffer + offset + 0) = (this->point_valid[i] >> (8 * 0)) & 0xFF; + offset += sizeof(this->point_valid[i]); + } + for( uint32_t i = 0; i < 5; i++){ + *(outbuffer + offset + 0) = (this->command[i] >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->command[i] >> (8 * 1)) & 0xFF; + offset += sizeof(this->command[i]); + } + for( uint32_t i = 0; i < 5; i++){ + union { + float real; + uint32_t base; + } u_time_horizoni; + u_time_horizoni.real = this->time_horizon[i]; + *(outbuffer + offset + 0) = (u_time_horizoni.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_time_horizoni.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_time_horizoni.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_time_horizoni.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->time_horizon[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + this->type = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->type); + offset += this->point_1.deserialize(inbuffer + offset); + offset += this->point_2.deserialize(inbuffer + offset); + offset += this->point_3.deserialize(inbuffer + offset); + offset += this->point_4.deserialize(inbuffer + offset); + offset += this->point_5.deserialize(inbuffer + offset); + for( uint32_t i = 0; i < 5; i++){ + this->point_valid[i] = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->point_valid[i]); + } + for( uint32_t i = 0; i < 5; i++){ + this->command[i] = ((uint16_t) (*(inbuffer + offset))); + this->command[i] |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->command[i]); + } + for( uint32_t i = 0; i < 5; i++){ + union { + float real; + uint32_t base; + } u_time_horizoni; + u_time_horizoni.base = 0; + u_time_horizoni.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_time_horizoni.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_time_horizoni.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_time_horizoni.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->time_horizon[i] = u_time_horizoni.real; + offset += sizeof(this->time_horizon[i]); + } + return offset; + } + + virtual const char * getType() override { return "mavros_msgs/Trajectory"; }; + virtual const char * getMD5() override { return "477b47a103394ad6be940e5705f338e8"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/Tunnel.h b/pio_workspace/lib/ros_lib/mavros_msgs/Tunnel.h new file mode 100644 index 0000000..b15ec7a --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/Tunnel.h @@ -0,0 +1,89 @@ +#ifndef _ROS_mavros_msgs_Tunnel_h +#define _ROS_mavros_msgs_Tunnel_h + +#include +#include +#include +#include "ros/msg.h" + +namespace mavros_msgs +{ + + class Tunnel : public ros::Msg + { + public: + typedef uint8_t _target_system_type; + _target_system_type target_system; + typedef uint8_t _target_component_type; + _target_component_type target_component; + typedef uint16_t _payload_type_type; + _payload_type_type payload_type; + typedef uint8_t _payload_length_type; + _payload_length_type payload_length; + uint8_t payload[128]; + enum { PAYLOAD_TYPE_UNKNOWN = 0 }; + enum { PAYLOAD_TYPE_STORM32_RESERVED0 = 200 }; + enum { PAYLOAD_TYPE_STORM32_RESERVED1 = 201 }; + enum { PAYLOAD_TYPE_STORM32_RESERVED2 = 202 }; + enum { PAYLOAD_TYPE_STORM32_RESERVED3 = 203 }; + enum { PAYLOAD_TYPE_STORM32_RESERVED4 = 204 }; + enum { PAYLOAD_TYPE_STORM32_RESERVED5 = 205 }; + enum { PAYLOAD_TYPE_STORM32_RESERVED6 = 206 }; + enum { PAYLOAD_TYPE_STORM32_RESERVED7 = 207 }; + enum { PAYLOAD_TYPE_STORM32_RESERVED8 = 208 }; + enum { PAYLOAD_TYPE_STORM32_RESERVED9 = 209 }; + + Tunnel(): + target_system(0), + target_component(0), + payload_type(0), + payload_length(0), + payload() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->target_system >> (8 * 0)) & 0xFF; + offset += sizeof(this->target_system); + *(outbuffer + offset + 0) = (this->target_component >> (8 * 0)) & 0xFF; + offset += sizeof(this->target_component); + *(outbuffer + offset + 0) = (this->payload_type >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->payload_type >> (8 * 1)) & 0xFF; + offset += sizeof(this->payload_type); + *(outbuffer + offset + 0) = (this->payload_length >> (8 * 0)) & 0xFF; + offset += sizeof(this->payload_length); + for( uint32_t i = 0; i < 128; i++){ + *(outbuffer + offset + 0) = (this->payload[i] >> (8 * 0)) & 0xFF; + offset += sizeof(this->payload[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->target_system = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->target_system); + this->target_component = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->target_component); + this->payload_type = ((uint16_t) (*(inbuffer + offset))); + this->payload_type |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->payload_type); + this->payload_length = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->payload_length); + for( uint32_t i = 0; i < 128; i++){ + this->payload[i] = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->payload[i]); + } + return offset; + } + + virtual const char * getType() override { return "mavros_msgs/Tunnel"; }; + virtual const char * getMD5() override { return "6d8c215067d3b319bbb219c37c1ebc5d"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/VFR_HUD.h b/pio_workspace/lib/ros_lib/mavros_msgs/VFR_HUD.h new file mode 100644 index 0000000..e098750 --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/VFR_HUD.h @@ -0,0 +1,184 @@ +#ifndef _ROS_mavros_msgs_VFR_HUD_h +#define _ROS_mavros_msgs_VFR_HUD_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace mavros_msgs +{ + + class VFR_HUD : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef float _airspeed_type; + _airspeed_type airspeed; + typedef float _groundspeed_type; + _groundspeed_type groundspeed; + typedef int16_t _heading_type; + _heading_type heading; + typedef float _throttle_type; + _throttle_type throttle; + typedef float _altitude_type; + _altitude_type altitude; + typedef float _climb_type; + _climb_type climb; + + VFR_HUD(): + header(), + airspeed(0), + groundspeed(0), + heading(0), + throttle(0), + altitude(0), + climb(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + union { + float real; + uint32_t base; + } u_airspeed; + u_airspeed.real = this->airspeed; + *(outbuffer + offset + 0) = (u_airspeed.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_airspeed.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_airspeed.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_airspeed.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->airspeed); + union { + float real; + uint32_t base; + } u_groundspeed; + u_groundspeed.real = this->groundspeed; + *(outbuffer + offset + 0) = (u_groundspeed.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_groundspeed.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_groundspeed.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_groundspeed.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->groundspeed); + union { + int16_t real; + uint16_t base; + } u_heading; + u_heading.real = this->heading; + *(outbuffer + offset + 0) = (u_heading.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_heading.base >> (8 * 1)) & 0xFF; + offset += sizeof(this->heading); + union { + float real; + uint32_t base; + } u_throttle; + u_throttle.real = this->throttle; + *(outbuffer + offset + 0) = (u_throttle.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_throttle.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_throttle.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_throttle.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->throttle); + union { + float real; + uint32_t base; + } u_altitude; + u_altitude.real = this->altitude; + *(outbuffer + offset + 0) = (u_altitude.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_altitude.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_altitude.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_altitude.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->altitude); + union { + float real; + uint32_t base; + } u_climb; + u_climb.real = this->climb; + *(outbuffer + offset + 0) = (u_climb.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_climb.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_climb.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_climb.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->climb); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + union { + float real; + uint32_t base; + } u_airspeed; + u_airspeed.base = 0; + u_airspeed.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_airspeed.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_airspeed.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_airspeed.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->airspeed = u_airspeed.real; + offset += sizeof(this->airspeed); + union { + float real; + uint32_t base; + } u_groundspeed; + u_groundspeed.base = 0; + u_groundspeed.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_groundspeed.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_groundspeed.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_groundspeed.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->groundspeed = u_groundspeed.real; + offset += sizeof(this->groundspeed); + union { + int16_t real; + uint16_t base; + } u_heading; + u_heading.base = 0; + u_heading.base |= ((uint16_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_heading.base |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->heading = u_heading.real; + offset += sizeof(this->heading); + union { + float real; + uint32_t base; + } u_throttle; + u_throttle.base = 0; + u_throttle.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_throttle.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_throttle.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_throttle.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->throttle = u_throttle.real; + offset += sizeof(this->throttle); + union { + float real; + uint32_t base; + } u_altitude; + u_altitude.base = 0; + u_altitude.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_altitude.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_altitude.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_altitude.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->altitude = u_altitude.real; + offset += sizeof(this->altitude); + union { + float real; + uint32_t base; + } u_climb; + u_climb.base = 0; + u_climb.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_climb.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_climb.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_climb.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->climb = u_climb.real; + offset += sizeof(this->climb); + return offset; + } + + virtual const char * getType() override { return "mavros_msgs/VFR_HUD"; }; + virtual const char * getMD5() override { return "1f55e210c3d39fe105d44d8dc963655f"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/VehicleInfo.h b/pio_workspace/lib/ros_lib/mavros_msgs/VehicleInfo.h new file mode 100644 index 0000000..55d1d8f --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/VehicleInfo.h @@ -0,0 +1,267 @@ +#ifndef _ROS_mavros_msgs_VehicleInfo_h +#define _ROS_mavros_msgs_VehicleInfo_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace mavros_msgs +{ + + class VehicleInfo : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef uint8_t _available_info_type; + _available_info_type available_info; + typedef uint8_t _sysid_type; + _sysid_type sysid; + typedef uint8_t _compid_type; + _compid_type compid; + typedef uint8_t _autopilot_type; + _autopilot_type autopilot; + typedef uint8_t _type_type; + _type_type type; + typedef uint8_t _system_status_type; + _system_status_type system_status; + typedef uint8_t _base_mode_type; + _base_mode_type base_mode; + typedef uint32_t _custom_mode_type; + _custom_mode_type custom_mode; + typedef const char* _mode_type; + _mode_type mode; + typedef uint32_t _mode_id_type; + _mode_id_type mode_id; + typedef uint64_t _capabilities_type; + _capabilities_type capabilities; + typedef uint32_t _flight_sw_version_type; + _flight_sw_version_type flight_sw_version; + typedef uint32_t _middleware_sw_version_type; + _middleware_sw_version_type middleware_sw_version; + typedef uint32_t _os_sw_version_type; + _os_sw_version_type os_sw_version; + typedef uint32_t _board_version_type; + _board_version_type board_version; + typedef const char* _flight_custom_version_type; + _flight_custom_version_type flight_custom_version; + typedef uint16_t _vendor_id_type; + _vendor_id_type vendor_id; + typedef uint16_t _product_id_type; + _product_id_type product_id; + typedef uint64_t _uid_type; + _uid_type uid; + enum { HAVE_INFO_HEARTBEAT = 1 }; + enum { HAVE_INFO_AUTOPILOT_VERSION = 2 }; + + VehicleInfo(): + header(), + available_info(0), + sysid(0), + compid(0), + autopilot(0), + type(0), + system_status(0), + base_mode(0), + custom_mode(0), + mode(""), + mode_id(0), + capabilities(0), + flight_sw_version(0), + middleware_sw_version(0), + os_sw_version(0), + board_version(0), + flight_custom_version(""), + vendor_id(0), + product_id(0), + uid(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->available_info >> (8 * 0)) & 0xFF; + offset += sizeof(this->available_info); + *(outbuffer + offset + 0) = (this->sysid >> (8 * 0)) & 0xFF; + offset += sizeof(this->sysid); + *(outbuffer + offset + 0) = (this->compid >> (8 * 0)) & 0xFF; + offset += sizeof(this->compid); + *(outbuffer + offset + 0) = (this->autopilot >> (8 * 0)) & 0xFF; + offset += sizeof(this->autopilot); + *(outbuffer + offset + 0) = (this->type >> (8 * 0)) & 0xFF; + offset += sizeof(this->type); + *(outbuffer + offset + 0) = (this->system_status >> (8 * 0)) & 0xFF; + offset += sizeof(this->system_status); + *(outbuffer + offset + 0) = (this->base_mode >> (8 * 0)) & 0xFF; + offset += sizeof(this->base_mode); + *(outbuffer + offset + 0) = (this->custom_mode >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->custom_mode >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->custom_mode >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->custom_mode >> (8 * 3)) & 0xFF; + offset += sizeof(this->custom_mode); + uint32_t length_mode = strlen(this->mode); + varToArr(outbuffer + offset, length_mode); + offset += 4; + memcpy(outbuffer + offset, this->mode, length_mode); + offset += length_mode; + *(outbuffer + offset + 0) = (this->mode_id >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->mode_id >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->mode_id >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->mode_id >> (8 * 3)) & 0xFF; + offset += sizeof(this->mode_id); + *(outbuffer + offset + 0) = (this->capabilities >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->capabilities >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->capabilities >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->capabilities >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (this->capabilities >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (this->capabilities >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (this->capabilities >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (this->capabilities >> (8 * 7)) & 0xFF; + offset += sizeof(this->capabilities); + *(outbuffer + offset + 0) = (this->flight_sw_version >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->flight_sw_version >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->flight_sw_version >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->flight_sw_version >> (8 * 3)) & 0xFF; + offset += sizeof(this->flight_sw_version); + *(outbuffer + offset + 0) = (this->middleware_sw_version >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->middleware_sw_version >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->middleware_sw_version >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->middleware_sw_version >> (8 * 3)) & 0xFF; + offset += sizeof(this->middleware_sw_version); + *(outbuffer + offset + 0) = (this->os_sw_version >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->os_sw_version >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->os_sw_version >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->os_sw_version >> (8 * 3)) & 0xFF; + offset += sizeof(this->os_sw_version); + *(outbuffer + offset + 0) = (this->board_version >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->board_version >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->board_version >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->board_version >> (8 * 3)) & 0xFF; + offset += sizeof(this->board_version); + uint32_t length_flight_custom_version = strlen(this->flight_custom_version); + varToArr(outbuffer + offset, length_flight_custom_version); + offset += 4; + memcpy(outbuffer + offset, this->flight_custom_version, length_flight_custom_version); + offset += length_flight_custom_version; + *(outbuffer + offset + 0) = (this->vendor_id >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->vendor_id >> (8 * 1)) & 0xFF; + offset += sizeof(this->vendor_id); + *(outbuffer + offset + 0) = (this->product_id >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->product_id >> (8 * 1)) & 0xFF; + offset += sizeof(this->product_id); + *(outbuffer + offset + 0) = (this->uid >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->uid >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->uid >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->uid >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (this->uid >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (this->uid >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (this->uid >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (this->uid >> (8 * 7)) & 0xFF; + offset += sizeof(this->uid); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + this->available_info = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->available_info); + this->sysid = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->sysid); + this->compid = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->compid); + this->autopilot = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->autopilot); + this->type = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->type); + this->system_status = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->system_status); + this->base_mode = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->base_mode); + this->custom_mode = ((uint32_t) (*(inbuffer + offset))); + this->custom_mode |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->custom_mode |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->custom_mode |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->custom_mode); + uint32_t length_mode; + arrToVar(length_mode, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_mode; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_mode-1]=0; + this->mode = (char *)(inbuffer + offset-1); + offset += length_mode; + this->mode_id = ((uint32_t) (*(inbuffer + offset))); + this->mode_id |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->mode_id |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->mode_id |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->mode_id); + this->capabilities = ((uint64_t) (*(inbuffer + offset))); + this->capabilities |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->capabilities |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->capabilities |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->capabilities |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + this->capabilities |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + this->capabilities |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + this->capabilities |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + offset += sizeof(this->capabilities); + this->flight_sw_version = ((uint32_t) (*(inbuffer + offset))); + this->flight_sw_version |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->flight_sw_version |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->flight_sw_version |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->flight_sw_version); + this->middleware_sw_version = ((uint32_t) (*(inbuffer + offset))); + this->middleware_sw_version |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->middleware_sw_version |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->middleware_sw_version |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->middleware_sw_version); + this->os_sw_version = ((uint32_t) (*(inbuffer + offset))); + this->os_sw_version |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->os_sw_version |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->os_sw_version |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->os_sw_version); + this->board_version = ((uint32_t) (*(inbuffer + offset))); + this->board_version |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->board_version |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->board_version |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->board_version); + uint32_t length_flight_custom_version; + arrToVar(length_flight_custom_version, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_flight_custom_version; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_flight_custom_version-1]=0; + this->flight_custom_version = (char *)(inbuffer + offset-1); + offset += length_flight_custom_version; + this->vendor_id = ((uint16_t) (*(inbuffer + offset))); + this->vendor_id |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->vendor_id); + this->product_id = ((uint16_t) (*(inbuffer + offset))); + this->product_id |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->product_id); + this->uid = ((uint64_t) (*(inbuffer + offset))); + this->uid |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->uid |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->uid |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->uid |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + this->uid |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + this->uid |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + this->uid |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + offset += sizeof(this->uid); + return offset; + } + + virtual const char * getType() override { return "mavros_msgs/VehicleInfo"; }; + virtual const char * getMD5() override { return "9afa55616f5936bd9469d7d85c523ac1"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/VehicleInfoGet.h b/pio_workspace/lib/ros_lib/mavros_msgs/VehicleInfoGet.h new file mode 100644 index 0000000..9d7bc7d --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/VehicleInfoGet.h @@ -0,0 +1,148 @@ +#ifndef _ROS_SERVICE_VehicleInfoGet_h +#define _ROS_SERVICE_VehicleInfoGet_h +#include +#include +#include +#include "ros/msg.h" +#include "mavros_msgs/VehicleInfo.h" + +namespace mavros_msgs +{ + +static const char VEHICLEINFOGET[] = "mavros_msgs/VehicleInfoGet"; + + class VehicleInfoGetRequest : public ros::Msg + { + public: + typedef uint8_t _sysid_type; + _sysid_type sysid; + typedef uint8_t _compid_type; + _compid_type compid; + typedef bool _get_all_type; + _get_all_type get_all; + enum { GET_MY_SYSID = 0 }; + enum { GET_MY_COMPID = 0 }; + + VehicleInfoGetRequest(): + sysid(0), + compid(0), + get_all(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->sysid >> (8 * 0)) & 0xFF; + offset += sizeof(this->sysid); + *(outbuffer + offset + 0) = (this->compid >> (8 * 0)) & 0xFF; + offset += sizeof(this->compid); + union { + bool real; + uint8_t base; + } u_get_all; + u_get_all.real = this->get_all; + *(outbuffer + offset + 0) = (u_get_all.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->get_all); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->sysid = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->sysid); + this->compid = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->compid); + union { + bool real; + uint8_t base; + } u_get_all; + u_get_all.base = 0; + u_get_all.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->get_all = u_get_all.real; + offset += sizeof(this->get_all); + return offset; + } + + virtual const char * getType() override { return VEHICLEINFOGET; }; + virtual const char * getMD5() override { return "c1911e97179d4b379a979e2ab8e01e5c"; }; + + }; + + class VehicleInfoGetResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + uint32_t vehicles_length; + typedef mavros_msgs::VehicleInfo _vehicles_type; + _vehicles_type st_vehicles; + _vehicles_type * vehicles; + + VehicleInfoGetResponse(): + success(0), + vehicles_length(0), st_vehicles(), vehicles(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + *(outbuffer + offset + 0) = (this->vehicles_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->vehicles_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->vehicles_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->vehicles_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->vehicles_length); + for( uint32_t i = 0; i < vehicles_length; i++){ + offset += this->vehicles[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t vehicles_lengthT = ((uint32_t) (*(inbuffer + offset))); + vehicles_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + vehicles_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + vehicles_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->vehicles_length); + if(vehicles_lengthT > vehicles_length) + this->vehicles = (mavros_msgs::VehicleInfo*)realloc(this->vehicles, vehicles_lengthT * sizeof(mavros_msgs::VehicleInfo)); + vehicles_length = vehicles_lengthT; + for( uint32_t i = 0; i < vehicles_length; i++){ + offset += this->st_vehicles.deserialize(inbuffer + offset); + memcpy( &(this->vehicles[i]), &(this->st_vehicles), sizeof(mavros_msgs::VehicleInfo)); + } + return offset; + } + + virtual const char * getType() override { return VEHICLEINFOGET; }; + virtual const char * getMD5() override { return "7b33b68f66a6b66456d3bed6fe1dfda0"; }; + + }; + + class VehicleInfoGet { + public: + typedef VehicleInfoGetRequest Request; + typedef VehicleInfoGetResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/Vibration.h b/pio_workspace/lib/ros_lib/mavros_msgs/Vibration.h new file mode 100644 index 0000000..a263930 --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/Vibration.h @@ -0,0 +1,77 @@ +#ifndef _ROS_mavros_msgs_Vibration_h +#define _ROS_mavros_msgs_Vibration_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Vector3.h" + +namespace mavros_msgs +{ + + class Vibration : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef geometry_msgs::Vector3 _vibration_type; + _vibration_type vibration; + float clipping[3]; + + Vibration(): + header(), + vibration(), + clipping() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->vibration.serialize(outbuffer + offset); + for( uint32_t i = 0; i < 3; i++){ + union { + float real; + uint32_t base; + } u_clippingi; + u_clippingi.real = this->clipping[i]; + *(outbuffer + offset + 0) = (u_clippingi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_clippingi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_clippingi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_clippingi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->clipping[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->vibration.deserialize(inbuffer + offset); + for( uint32_t i = 0; i < 3; i++){ + union { + float real; + uint32_t base; + } u_clippingi; + u_clippingi.base = 0; + u_clippingi.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_clippingi.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_clippingi.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_clippingi.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->clipping[i] = u_clippingi.real; + offset += sizeof(this->clipping[i]); + } + return offset; + } + + virtual const char * getType() override { return "mavros_msgs/Vibration"; }; + virtual const char * getMD5() override { return "eb92bf9b7aa735dfcd06b3ede5027d02"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/Waypoint.h b/pio_workspace/lib/ros_lib/mavros_msgs/Waypoint.h new file mode 100644 index 0000000..8c77f79 --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/Waypoint.h @@ -0,0 +1,223 @@ +#ifndef _ROS_mavros_msgs_Waypoint_h +#define _ROS_mavros_msgs_Waypoint_h + +#include +#include +#include +#include "ros/msg.h" + +namespace mavros_msgs +{ + + class Waypoint : public ros::Msg + { + public: + typedef uint8_t _frame_type; + _frame_type frame; + typedef uint16_t _command_type; + _command_type command; + typedef bool _is_current_type; + _is_current_type is_current; + typedef bool _autocontinue_type; + _autocontinue_type autocontinue; + typedef float _param1_type; + _param1_type param1; + typedef float _param2_type; + _param2_type param2; + typedef float _param3_type; + _param3_type param3; + typedef float _param4_type; + _param4_type param4; + typedef float _x_lat_type; + _x_lat_type x_lat; + typedef float _y_long_type; + _y_long_type y_long; + typedef float _z_alt_type; + _z_alt_type z_alt; + enum { FRAME_GLOBAL = 0 }; + enum { FRAME_LOCAL_NED = 1 }; + enum { FRAME_MISSION = 2 }; + enum { FRAME_GLOBAL_REL_ALT = 3 }; + enum { FRAME_LOCAL_ENU = 4 }; + enum { FRAME_GLOBAL_INT = 5 }; + enum { FRAME_GLOBAL_RELATIVE_ALT_INT = 6 }; + enum { FRAME_LOCAL_OFFSET_NED = 7 }; + enum { FRAME_BODY_NED = 8 }; + enum { FRAME_BODY_OFFSET_NED = 9 }; + enum { FRAME_GLOBAL_TERRAIN_ALT = 10 }; + enum { FRAME_GLOBAL_TERRAIN_ALT_INT = 11 }; + enum { FRAME_BODY_FRD = 12 }; + enum { FRAME_RESERVED_13 = 13 }; + enum { FRAME_RESERVED_14 = 14 }; + enum { FRAME_RESERVED_15 = 15 }; + enum { FRAME_RESERVED_16 = 16 }; + enum { FRAME_RESERVED_17 = 17 }; + enum { FRAME_RESERVED_18 = 18 }; + enum { FRAME_RESERVED_19 = 19 }; + enum { FRAME_LOCAL_FRD = 20 }; + enum { FRAME_LOCAL_FLU = 21 }; + + Waypoint(): + frame(0), + command(0), + is_current(0), + autocontinue(0), + param1(0), + param2(0), + param3(0), + param4(0), + x_lat(0), + y_long(0), + z_alt(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->frame >> (8 * 0)) & 0xFF; + offset += sizeof(this->frame); + *(outbuffer + offset + 0) = (this->command >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->command >> (8 * 1)) & 0xFF; + offset += sizeof(this->command); + union { + bool real; + uint8_t base; + } u_is_current; + u_is_current.real = this->is_current; + *(outbuffer + offset + 0) = (u_is_current.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->is_current); + union { + bool real; + uint8_t base; + } u_autocontinue; + u_autocontinue.real = this->autocontinue; + *(outbuffer + offset + 0) = (u_autocontinue.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->autocontinue); + union { + float real; + uint32_t base; + } u_param1; + u_param1.real = this->param1; + *(outbuffer + offset + 0) = (u_param1.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_param1.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_param1.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_param1.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->param1); + union { + float real; + uint32_t base; + } u_param2; + u_param2.real = this->param2; + *(outbuffer + offset + 0) = (u_param2.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_param2.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_param2.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_param2.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->param2); + union { + float real; + uint32_t base; + } u_param3; + u_param3.real = this->param3; + *(outbuffer + offset + 0) = (u_param3.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_param3.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_param3.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_param3.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->param3); + union { + float real; + uint32_t base; + } u_param4; + u_param4.real = this->param4; + *(outbuffer + offset + 0) = (u_param4.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_param4.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_param4.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_param4.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->param4); + offset += serializeAvrFloat64(outbuffer + offset, this->x_lat); + offset += serializeAvrFloat64(outbuffer + offset, this->y_long); + offset += serializeAvrFloat64(outbuffer + offset, this->z_alt); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->frame = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->frame); + this->command = ((uint16_t) (*(inbuffer + offset))); + this->command |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->command); + union { + bool real; + uint8_t base; + } u_is_current; + u_is_current.base = 0; + u_is_current.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->is_current = u_is_current.real; + offset += sizeof(this->is_current); + union { + bool real; + uint8_t base; + } u_autocontinue; + u_autocontinue.base = 0; + u_autocontinue.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->autocontinue = u_autocontinue.real; + offset += sizeof(this->autocontinue); + union { + float real; + uint32_t base; + } u_param1; + u_param1.base = 0; + u_param1.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_param1.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_param1.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_param1.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->param1 = u_param1.real; + offset += sizeof(this->param1); + union { + float real; + uint32_t base; + } u_param2; + u_param2.base = 0; + u_param2.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_param2.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_param2.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_param2.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->param2 = u_param2.real; + offset += sizeof(this->param2); + union { + float real; + uint32_t base; + } u_param3; + u_param3.base = 0; + u_param3.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_param3.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_param3.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_param3.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->param3 = u_param3.real; + offset += sizeof(this->param3); + union { + float real; + uint32_t base; + } u_param4; + u_param4.base = 0; + u_param4.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_param4.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_param4.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_param4.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->param4 = u_param4.real; + offset += sizeof(this->param4); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->x_lat)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->y_long)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->z_alt)); + return offset; + } + + virtual const char * getType() override { return "mavros_msgs/Waypoint"; }; + virtual const char * getMD5() override { return "f7090ce9f0c7ad0665de1ddadfd11ace"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/WaypointClear.h b/pio_workspace/lib/ros_lib/mavros_msgs/WaypointClear.h new file mode 100644 index 0000000..abe8829 --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/WaypointClear.h @@ -0,0 +1,88 @@ +#ifndef _ROS_SERVICE_WaypointClear_h +#define _ROS_SERVICE_WaypointClear_h +#include +#include +#include +#include "ros/msg.h" + +namespace mavros_msgs +{ + +static const char WAYPOINTCLEAR[] = "mavros_msgs/WaypointClear"; + + class WaypointClearRequest : public ros::Msg + { + public: + + WaypointClearRequest() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + return offset; + } + + virtual const char * getType() override { return WAYPOINTCLEAR; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class WaypointClearResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + + WaypointClearResponse(): + success(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + return offset; + } + + virtual const char * getType() override { return WAYPOINTCLEAR; }; + virtual const char * getMD5() override { return "358e233cde0c8a8bcfea4ce193f8fc15"; }; + + }; + + class WaypointClear { + public: + typedef WaypointClearRequest Request; + typedef WaypointClearResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/WaypointList.h b/pio_workspace/lib/ros_lib/mavros_msgs/WaypointList.h new file mode 100644 index 0000000..a85510b --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/WaypointList.h @@ -0,0 +1,73 @@ +#ifndef _ROS_mavros_msgs_WaypointList_h +#define _ROS_mavros_msgs_WaypointList_h + +#include +#include +#include +#include "ros/msg.h" +#include "mavros_msgs/Waypoint.h" + +namespace mavros_msgs +{ + + class WaypointList : public ros::Msg + { + public: + typedef uint16_t _current_seq_type; + _current_seq_type current_seq; + uint32_t waypoints_length; + typedef mavros_msgs::Waypoint _waypoints_type; + _waypoints_type st_waypoints; + _waypoints_type * waypoints; + + WaypointList(): + current_seq(0), + waypoints_length(0), st_waypoints(), waypoints(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->current_seq >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->current_seq >> (8 * 1)) & 0xFF; + offset += sizeof(this->current_seq); + *(outbuffer + offset + 0) = (this->waypoints_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->waypoints_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->waypoints_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->waypoints_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->waypoints_length); + for( uint32_t i = 0; i < waypoints_length; i++){ + offset += this->waypoints[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->current_seq = ((uint16_t) (*(inbuffer + offset))); + this->current_seq |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->current_seq); + uint32_t waypoints_lengthT = ((uint32_t) (*(inbuffer + offset))); + waypoints_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + waypoints_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + waypoints_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->waypoints_length); + if(waypoints_lengthT > waypoints_length) + this->waypoints = (mavros_msgs::Waypoint*)realloc(this->waypoints, waypoints_lengthT * sizeof(mavros_msgs::Waypoint)); + waypoints_length = waypoints_lengthT; + for( uint32_t i = 0; i < waypoints_length; i++){ + offset += this->st_waypoints.deserialize(inbuffer + offset); + memcpy( &(this->waypoints[i]), &(this->st_waypoints), sizeof(mavros_msgs::Waypoint)); + } + return offset; + } + + virtual const char * getType() override { return "mavros_msgs/WaypointList"; }; + virtual const char * getMD5() override { return "0605a2df153acd9a4a4823385ed81b57"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/WaypointPull.h b/pio_workspace/lib/ros_lib/mavros_msgs/WaypointPull.h new file mode 100644 index 0000000..87b649b --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/WaypointPull.h @@ -0,0 +1,101 @@ +#ifndef _ROS_SERVICE_WaypointPull_h +#define _ROS_SERVICE_WaypointPull_h +#include +#include +#include +#include "ros/msg.h" + +namespace mavros_msgs +{ + +static const char WAYPOINTPULL[] = "mavros_msgs/WaypointPull"; + + class WaypointPullRequest : public ros::Msg + { + public: + + WaypointPullRequest() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + return offset; + } + + virtual const char * getType() override { return WAYPOINTPULL; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class WaypointPullResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + typedef uint32_t _wp_received_type; + _wp_received_type wp_received; + + WaypointPullResponse(): + success(0), + wp_received(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + *(outbuffer + offset + 0) = (this->wp_received >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->wp_received >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->wp_received >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->wp_received >> (8 * 3)) & 0xFF; + offset += sizeof(this->wp_received); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + this->wp_received = ((uint32_t) (*(inbuffer + offset))); + this->wp_received |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->wp_received |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->wp_received |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->wp_received); + return offset; + } + + virtual const char * getType() override { return WAYPOINTPULL; }; + virtual const char * getMD5() override { return "a8d9ecef8fb37028d2db2a9aa4ed7e79"; }; + + }; + + class WaypointPull { + public: + typedef WaypointPullRequest Request; + typedef WaypointPullResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/WaypointPush.h b/pio_workspace/lib/ros_lib/mavros_msgs/WaypointPush.h new file mode 100644 index 0000000..630a686 --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/WaypointPush.h @@ -0,0 +1,136 @@ +#ifndef _ROS_SERVICE_WaypointPush_h +#define _ROS_SERVICE_WaypointPush_h +#include +#include +#include +#include "ros/msg.h" +#include "mavros_msgs/Waypoint.h" + +namespace mavros_msgs +{ + +static const char WAYPOINTPUSH[] = "mavros_msgs/WaypointPush"; + + class WaypointPushRequest : public ros::Msg + { + public: + typedef uint16_t _start_index_type; + _start_index_type start_index; + uint32_t waypoints_length; + typedef mavros_msgs::Waypoint _waypoints_type; + _waypoints_type st_waypoints; + _waypoints_type * waypoints; + + WaypointPushRequest(): + start_index(0), + waypoints_length(0), st_waypoints(), waypoints(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->start_index >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->start_index >> (8 * 1)) & 0xFF; + offset += sizeof(this->start_index); + *(outbuffer + offset + 0) = (this->waypoints_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->waypoints_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->waypoints_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->waypoints_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->waypoints_length); + for( uint32_t i = 0; i < waypoints_length; i++){ + offset += this->waypoints[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->start_index = ((uint16_t) (*(inbuffer + offset))); + this->start_index |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->start_index); + uint32_t waypoints_lengthT = ((uint32_t) (*(inbuffer + offset))); + waypoints_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + waypoints_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + waypoints_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->waypoints_length); + if(waypoints_lengthT > waypoints_length) + this->waypoints = (mavros_msgs::Waypoint*)realloc(this->waypoints, waypoints_lengthT * sizeof(mavros_msgs::Waypoint)); + waypoints_length = waypoints_lengthT; + for( uint32_t i = 0; i < waypoints_length; i++){ + offset += this->st_waypoints.deserialize(inbuffer + offset); + memcpy( &(this->waypoints[i]), &(this->st_waypoints), sizeof(mavros_msgs::Waypoint)); + } + return offset; + } + + virtual const char * getType() override { return WAYPOINTPUSH; }; + virtual const char * getMD5() override { return "b97216c84680b216429bf6c603ab2e03"; }; + + }; + + class WaypointPushResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + typedef uint32_t _wp_transfered_type; + _wp_transfered_type wp_transfered; + + WaypointPushResponse(): + success(0), + wp_transfered(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + *(outbuffer + offset + 0) = (this->wp_transfered >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->wp_transfered >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->wp_transfered >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->wp_transfered >> (8 * 3)) & 0xFF; + offset += sizeof(this->wp_transfered); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + this->wp_transfered = ((uint32_t) (*(inbuffer + offset))); + this->wp_transfered |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->wp_transfered |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->wp_transfered |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->wp_transfered); + return offset; + } + + virtual const char * getType() override { return WAYPOINTPUSH; }; + virtual const char * getMD5() override { return "90e0074a42480231d34eed864d14365e"; }; + + }; + + class WaypointPush { + public: + typedef WaypointPushRequest Request; + typedef WaypointPushResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/WaypointReached.h b/pio_workspace/lib/ros_lib/mavros_msgs/WaypointReached.h new file mode 100644 index 0000000..75db90e --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/WaypointReached.h @@ -0,0 +1,53 @@ +#ifndef _ROS_mavros_msgs_WaypointReached_h +#define _ROS_mavros_msgs_WaypointReached_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace mavros_msgs +{ + + class WaypointReached : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef uint16_t _wp_seq_type; + _wp_seq_type wp_seq; + + WaypointReached(): + header(), + wp_seq(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->wp_seq >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->wp_seq >> (8 * 1)) & 0xFF; + offset += sizeof(this->wp_seq); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + this->wp_seq = ((uint16_t) (*(inbuffer + offset))); + this->wp_seq |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->wp_seq); + return offset; + } + + virtual const char * getType() override { return "mavros_msgs/WaypointReached"; }; + virtual const char * getMD5() override { return "1cf64d072d9f6aa0a6715922bdde6a35"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/mavros_msgs/WaypointSetCurrent.h b/pio_workspace/lib/ros_lib/mavros_msgs/WaypointSetCurrent.h new file mode 100644 index 0000000..a413a6f --- /dev/null +++ b/pio_workspace/lib/ros_lib/mavros_msgs/WaypointSetCurrent.h @@ -0,0 +1,97 @@ +#ifndef _ROS_SERVICE_WaypointSetCurrent_h +#define _ROS_SERVICE_WaypointSetCurrent_h +#include +#include +#include +#include "ros/msg.h" + +namespace mavros_msgs +{ + +static const char WAYPOINTSETCURRENT[] = "mavros_msgs/WaypointSetCurrent"; + + class WaypointSetCurrentRequest : public ros::Msg + { + public: + typedef uint16_t _wp_seq_type; + _wp_seq_type wp_seq; + + WaypointSetCurrentRequest(): + wp_seq(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->wp_seq >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->wp_seq >> (8 * 1)) & 0xFF; + offset += sizeof(this->wp_seq); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->wp_seq = ((uint16_t) (*(inbuffer + offset))); + this->wp_seq |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->wp_seq); + return offset; + } + + virtual const char * getType() override { return WAYPOINTSETCURRENT; }; + virtual const char * getMD5() override { return "9541369175e0776b0fef1c988db6840f"; }; + + }; + + class WaypointSetCurrentResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + + WaypointSetCurrentResponse(): + success(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + return offset; + } + + virtual const char * getType() override { return WAYPOINTSETCURRENT; }; + virtual const char * getMD5() override { return "358e233cde0c8a8bcfea4ce193f8fc15"; }; + + }; + + class WaypointSetCurrent { + public: + typedef WaypointSetCurrentRequest Request; + typedef WaypointSetCurrentResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/rospy_tutorials/Floats.h b/pio_workspace/lib/ros_lib/mavros_msgs/WheelOdomStamped.h similarity index 55% rename from pio_workspace/lib/ros_lib/rospy_tutorials/Floats.h rename to pio_workspace/lib/ros_lib/mavros_msgs/WheelOdomStamped.h index 77027c5..8c8c6e3 100644 --- a/pio_workspace/lib/ros_lib/rospy_tutorials/Floats.h +++ b/pio_workspace/lib/ros_lib/mavros_msgs/WheelOdomStamped.h @@ -1,23 +1,27 @@ -#ifndef _ROS_rospy_tutorials_Floats_h -#define _ROS_rospy_tutorials_Floats_h +#ifndef _ROS_mavros_msgs_WheelOdomStamped_h +#define _ROS_mavros_msgs_WheelOdomStamped_h #include #include #include #include "ros/msg.h" +#include "std_msgs/Header.h" -namespace rospy_tutorials +namespace mavros_msgs { - class Floats : public ros::Msg + class WheelOdomStamped : public ros::Msg { public: + typedef std_msgs::Header _header_type; + _header_type header; uint32_t data_length; typedef float _data_type; _data_type st_data; _data_type * data; - Floats(): + WheelOdomStamped(): + header(), data_length(0), st_data(), data(nullptr) { } @@ -25,22 +29,14 @@ namespace rospy_tutorials virtual int serialize(unsigned char *outbuffer) const override { int offset = 0; + offset += this->header.serialize(outbuffer + offset); *(outbuffer + offset + 0) = (this->data_length >> (8 * 0)) & 0xFF; *(outbuffer + offset + 1) = (this->data_length >> (8 * 1)) & 0xFF; *(outbuffer + offset + 2) = (this->data_length >> (8 * 2)) & 0xFF; *(outbuffer + offset + 3) = (this->data_length >> (8 * 3)) & 0xFF; offset += sizeof(this->data_length); for( uint32_t i = 0; i < data_length; i++){ - union { - float real; - uint32_t base; - } u_datai; - u_datai.real = this->data[i]; - *(outbuffer + offset + 0) = (u_datai.base >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (u_datai.base >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (u_datai.base >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (u_datai.base >> (8 * 3)) & 0xFF; - offset += sizeof(this->data[i]); + offset += serializeAvrFloat64(outbuffer + offset, this->data[i]); } return offset; } @@ -48,6 +44,7 @@ namespace rospy_tutorials virtual int deserialize(unsigned char *inbuffer) override { int offset = 0; + offset += this->header.deserialize(inbuffer + offset); uint32_t data_lengthT = ((uint32_t) (*(inbuffer + offset))); data_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); data_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); @@ -57,24 +54,14 @@ namespace rospy_tutorials this->data = (float*)realloc(this->data, data_lengthT * sizeof(float)); data_length = data_lengthT; for( uint32_t i = 0; i < data_length; i++){ - union { - float real; - uint32_t base; - } u_st_data; - u_st_data.base = 0; - u_st_data.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); - u_st_data.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - u_st_data.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - u_st_data.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - this->st_data = u_st_data.real; - offset += sizeof(this->st_data); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_data)); memcpy( &(this->data[i]), &(this->st_data), sizeof(float)); } return offset; } - virtual const char * getType() override { return "rospy_tutorials/Floats"; }; - virtual const char * getMD5() override { return "420cd38b6b071cd49f2970c3e2cee511"; }; + virtual const char * getType() override { return "mavros_msgs/WheelOdomStamped"; }; + virtual const char * getMD5() override { return "fb60495edd59d3fcf90e173153ae8a9a"; }; }; diff --git a/pio_workspace/lib/ros_lib/turtle_actionlib/ShapeAction.h b/pio_workspace/lib/ros_lib/move_base_msgs/MoveBaseAction.h similarity index 57% rename from pio_workspace/lib/ros_lib/turtle_actionlib/ShapeAction.h rename to pio_workspace/lib/ros_lib/move_base_msgs/MoveBaseAction.h index 4239af1..dd2d33e 100644 --- a/pio_workspace/lib/ros_lib/turtle_actionlib/ShapeAction.h +++ b/pio_workspace/lib/ros_lib/move_base_msgs/MoveBaseAction.h @@ -1,28 +1,28 @@ -#ifndef _ROS_turtle_actionlib_ShapeAction_h -#define _ROS_turtle_actionlib_ShapeAction_h +#ifndef _ROS_move_base_msgs_MoveBaseAction_h +#define _ROS_move_base_msgs_MoveBaseAction_h #include #include #include #include "ros/msg.h" -#include "turtle_actionlib/ShapeActionGoal.h" -#include "turtle_actionlib/ShapeActionResult.h" -#include "turtle_actionlib/ShapeActionFeedback.h" +#include "move_base_msgs/MoveBaseActionGoal.h" +#include "move_base_msgs/MoveBaseActionResult.h" +#include "move_base_msgs/MoveBaseActionFeedback.h" -namespace turtle_actionlib +namespace move_base_msgs { - class ShapeAction : public ros::Msg + class MoveBaseAction : public ros::Msg { public: - typedef turtle_actionlib::ShapeActionGoal _action_goal_type; + typedef move_base_msgs::MoveBaseActionGoal _action_goal_type; _action_goal_type action_goal; - typedef turtle_actionlib::ShapeActionResult _action_result_type; + typedef move_base_msgs::MoveBaseActionResult _action_result_type; _action_result_type action_result; - typedef turtle_actionlib::ShapeActionFeedback _action_feedback_type; + typedef move_base_msgs::MoveBaseActionFeedback _action_feedback_type; _action_feedback_type action_feedback; - ShapeAction(): + MoveBaseAction(): action_goal(), action_result(), action_feedback() @@ -47,8 +47,8 @@ namespace turtle_actionlib return offset; } - virtual const char * getType() override { return "turtle_actionlib/ShapeAction"; }; - virtual const char * getMD5() override { return "d73b17d6237a925511f5d7727a1dc903"; }; + virtual const char * getType() override { return "move_base_msgs/MoveBaseAction"; }; + virtual const char * getMD5() override { return "70b6aca7c7f7746d8d1609ad94c80bb8"; }; }; diff --git a/pio_workspace/lib/ros_lib/turtle_actionlib/ShapeActionFeedback.h b/pio_workspace/lib/ros_lib/move_base_msgs/MoveBaseActionFeedback.h similarity index 67% rename from pio_workspace/lib/ros_lib/turtle_actionlib/ShapeActionFeedback.h rename to pio_workspace/lib/ros_lib/move_base_msgs/MoveBaseActionFeedback.h index 8f1122d..216fd77 100644 --- a/pio_workspace/lib/ros_lib/turtle_actionlib/ShapeActionFeedback.h +++ b/pio_workspace/lib/ros_lib/move_base_msgs/MoveBaseActionFeedback.h @@ -1,5 +1,5 @@ -#ifndef _ROS_turtle_actionlib_ShapeActionFeedback_h -#define _ROS_turtle_actionlib_ShapeActionFeedback_h +#ifndef _ROS_move_base_msgs_MoveBaseActionFeedback_h +#define _ROS_move_base_msgs_MoveBaseActionFeedback_h #include #include @@ -7,22 +7,22 @@ #include "ros/msg.h" #include "std_msgs/Header.h" #include "actionlib_msgs/GoalStatus.h" -#include "turtle_actionlib/ShapeFeedback.h" +#include "move_base_msgs/MoveBaseFeedback.h" -namespace turtle_actionlib +namespace move_base_msgs { - class ShapeActionFeedback : public ros::Msg + class MoveBaseActionFeedback : public ros::Msg { public: typedef std_msgs::Header _header_type; _header_type header; typedef actionlib_msgs::GoalStatus _status_type; _status_type status; - typedef turtle_actionlib::ShapeFeedback _feedback_type; + typedef move_base_msgs::MoveBaseFeedback _feedback_type; _feedback_type feedback; - ShapeActionFeedback(): + MoveBaseActionFeedback(): header(), status(), feedback() @@ -47,8 +47,8 @@ namespace turtle_actionlib return offset; } - virtual const char * getType() override { return "turtle_actionlib/ShapeActionFeedback"; }; - virtual const char * getMD5() override { return "aae20e09065c3809e8a8e87c4c8953fd"; }; + virtual const char * getType() override { return "move_base_msgs/MoveBaseActionFeedback"; }; + virtual const char * getMD5() override { return "7d1870ff6e0decea702b943b5af0b42e"; }; }; diff --git a/pio_workspace/lib/ros_lib/turtle_actionlib/ShapeActionGoal.h b/pio_workspace/lib/ros_lib/move_base_msgs/MoveBaseActionGoal.h similarity index 68% rename from pio_workspace/lib/ros_lib/turtle_actionlib/ShapeActionGoal.h rename to pio_workspace/lib/ros_lib/move_base_msgs/MoveBaseActionGoal.h index bd0d19c..6bc4cb1 100644 --- a/pio_workspace/lib/ros_lib/turtle_actionlib/ShapeActionGoal.h +++ b/pio_workspace/lib/ros_lib/move_base_msgs/MoveBaseActionGoal.h @@ -1,5 +1,5 @@ -#ifndef _ROS_turtle_actionlib_ShapeActionGoal_h -#define _ROS_turtle_actionlib_ShapeActionGoal_h +#ifndef _ROS_move_base_msgs_MoveBaseActionGoal_h +#define _ROS_move_base_msgs_MoveBaseActionGoal_h #include #include @@ -7,22 +7,22 @@ #include "ros/msg.h" #include "std_msgs/Header.h" #include "actionlib_msgs/GoalID.h" -#include "turtle_actionlib/ShapeGoal.h" +#include "move_base_msgs/MoveBaseGoal.h" -namespace turtle_actionlib +namespace move_base_msgs { - class ShapeActionGoal : public ros::Msg + class MoveBaseActionGoal : public ros::Msg { public: typedef std_msgs::Header _header_type; _header_type header; typedef actionlib_msgs::GoalID _goal_id_type; _goal_id_type goal_id; - typedef turtle_actionlib::ShapeGoal _goal_type; + typedef move_base_msgs::MoveBaseGoal _goal_type; _goal_type goal; - ShapeActionGoal(): + MoveBaseActionGoal(): header(), goal_id(), goal() @@ -47,8 +47,8 @@ namespace turtle_actionlib return offset; } - virtual const char * getType() override { return "turtle_actionlib/ShapeActionGoal"; }; - virtual const char * getMD5() override { return "dbfccd187f2ec9c593916447ffd6cc77"; }; + virtual const char * getType() override { return "move_base_msgs/MoveBaseActionGoal"; }; + virtual const char * getMD5() override { return "660d6895a1b9a16dce51fbdd9a64a56b"; }; }; diff --git a/pio_workspace/lib/ros_lib/turtle_actionlib/ShapeActionResult.h b/pio_workspace/lib/ros_lib/move_base_msgs/MoveBaseActionResult.h similarity index 67% rename from pio_workspace/lib/ros_lib/turtle_actionlib/ShapeActionResult.h rename to pio_workspace/lib/ros_lib/move_base_msgs/MoveBaseActionResult.h index a0079ae..809122c 100644 --- a/pio_workspace/lib/ros_lib/turtle_actionlib/ShapeActionResult.h +++ b/pio_workspace/lib/ros_lib/move_base_msgs/MoveBaseActionResult.h @@ -1,5 +1,5 @@ -#ifndef _ROS_turtle_actionlib_ShapeActionResult_h -#define _ROS_turtle_actionlib_ShapeActionResult_h +#ifndef _ROS_move_base_msgs_MoveBaseActionResult_h +#define _ROS_move_base_msgs_MoveBaseActionResult_h #include #include @@ -7,22 +7,22 @@ #include "ros/msg.h" #include "std_msgs/Header.h" #include "actionlib_msgs/GoalStatus.h" -#include "turtle_actionlib/ShapeResult.h" +#include "move_base_msgs/MoveBaseResult.h" -namespace turtle_actionlib +namespace move_base_msgs { - class ShapeActionResult : public ros::Msg + class MoveBaseActionResult : public ros::Msg { public: typedef std_msgs::Header _header_type; _header_type header; typedef actionlib_msgs::GoalStatus _status_type; _status_type status; - typedef turtle_actionlib::ShapeResult _result_type; + typedef move_base_msgs::MoveBaseResult _result_type; _result_type result; - ShapeActionResult(): + MoveBaseActionResult(): header(), status(), result() @@ -47,8 +47,8 @@ namespace turtle_actionlib return offset; } - virtual const char * getType() override { return "turtle_actionlib/ShapeActionResult"; }; - virtual const char * getMD5() override { return "c8d13d5d140f1047a2e4d3bf5c045822"; }; + virtual const char * getType() override { return "move_base_msgs/MoveBaseActionResult"; }; + virtual const char * getMD5() override { return "1eb06eeff08fa7ea874431638cb52332"; }; }; diff --git a/pio_workspace/lib/ros_lib/move_base_msgs/MoveBaseFeedback.h b/pio_workspace/lib/ros_lib/move_base_msgs/MoveBaseFeedback.h new file mode 100644 index 0000000..4bcd0ac --- /dev/null +++ b/pio_workspace/lib/ros_lib/move_base_msgs/MoveBaseFeedback.h @@ -0,0 +1,44 @@ +#ifndef _ROS_move_base_msgs_MoveBaseFeedback_h +#define _ROS_move_base_msgs_MoveBaseFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/PoseStamped.h" + +namespace move_base_msgs +{ + + class MoveBaseFeedback : public ros::Msg + { + public: + typedef geometry_msgs::PoseStamped _base_position_type; + _base_position_type base_position; + + MoveBaseFeedback(): + base_position() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->base_position.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->base_position.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "move_base_msgs/MoveBaseFeedback"; }; + virtual const char * getMD5() override { return "3fb824c456a757373a226f6d08071bf0"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/move_base_msgs/MoveBaseGoal.h b/pio_workspace/lib/ros_lib/move_base_msgs/MoveBaseGoal.h new file mode 100644 index 0000000..0a4b029 --- /dev/null +++ b/pio_workspace/lib/ros_lib/move_base_msgs/MoveBaseGoal.h @@ -0,0 +1,44 @@ +#ifndef _ROS_move_base_msgs_MoveBaseGoal_h +#define _ROS_move_base_msgs_MoveBaseGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/PoseStamped.h" + +namespace move_base_msgs +{ + + class MoveBaseGoal : public ros::Msg + { + public: + typedef geometry_msgs::PoseStamped _target_pose_type; + _target_pose_type target_pose; + + MoveBaseGoal(): + target_pose() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->target_pose.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->target_pose.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "move_base_msgs/MoveBaseGoal"; }; + virtual const char * getMD5() override { return "257d089627d7eb7136c24d3593d05a16"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/turtle_actionlib/ShapeFeedback.h b/pio_workspace/lib/ros_lib/move_base_msgs/MoveBaseResult.h similarity index 63% rename from pio_workspace/lib/ros_lib/turtle_actionlib/ShapeFeedback.h rename to pio_workspace/lib/ros_lib/move_base_msgs/MoveBaseResult.h index 0f86541..a8844e4 100644 --- a/pio_workspace/lib/ros_lib/turtle_actionlib/ShapeFeedback.h +++ b/pio_workspace/lib/ros_lib/move_base_msgs/MoveBaseResult.h @@ -1,19 +1,19 @@ -#ifndef _ROS_turtle_actionlib_ShapeFeedback_h -#define _ROS_turtle_actionlib_ShapeFeedback_h +#ifndef _ROS_move_base_msgs_MoveBaseResult_h +#define _ROS_move_base_msgs_MoveBaseResult_h #include #include #include #include "ros/msg.h" -namespace turtle_actionlib +namespace move_base_msgs { - class ShapeFeedback : public ros::Msg + class MoveBaseResult : public ros::Msg { public: - ShapeFeedback() + MoveBaseResult() { } @@ -29,7 +29,7 @@ namespace turtle_actionlib return offset; } - virtual const char * getType() override { return "turtle_actionlib/ShapeFeedback"; }; + virtual const char * getType() override { return "move_base_msgs/MoveBaseResult"; }; virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; }; diff --git a/pio_workspace/lib/ros_lib/move_base_msgs/RecoveryStatus.h b/pio_workspace/lib/ros_lib/move_base_msgs/RecoveryStatus.h new file mode 100644 index 0000000..8568ea7 --- /dev/null +++ b/pio_workspace/lib/ros_lib/move_base_msgs/RecoveryStatus.h @@ -0,0 +1,79 @@ +#ifndef _ROS_move_base_msgs_RecoveryStatus_h +#define _ROS_move_base_msgs_RecoveryStatus_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/PoseStamped.h" + +namespace move_base_msgs +{ + + class RecoveryStatus : public ros::Msg + { + public: + typedef geometry_msgs::PoseStamped _pose_stamped_type; + _pose_stamped_type pose_stamped; + typedef uint16_t _current_recovery_number_type; + _current_recovery_number_type current_recovery_number; + typedef uint16_t _total_number_of_recoveries_type; + _total_number_of_recoveries_type total_number_of_recoveries; + typedef const char* _recovery_behavior_name_type; + _recovery_behavior_name_type recovery_behavior_name; + + RecoveryStatus(): + pose_stamped(), + current_recovery_number(0), + total_number_of_recoveries(0), + recovery_behavior_name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->pose_stamped.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->current_recovery_number >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->current_recovery_number >> (8 * 1)) & 0xFF; + offset += sizeof(this->current_recovery_number); + *(outbuffer + offset + 0) = (this->total_number_of_recoveries >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->total_number_of_recoveries >> (8 * 1)) & 0xFF; + offset += sizeof(this->total_number_of_recoveries); + uint32_t length_recovery_behavior_name = strlen(this->recovery_behavior_name); + varToArr(outbuffer + offset, length_recovery_behavior_name); + offset += 4; + memcpy(outbuffer + offset, this->recovery_behavior_name, length_recovery_behavior_name); + offset += length_recovery_behavior_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->pose_stamped.deserialize(inbuffer + offset); + this->current_recovery_number = ((uint16_t) (*(inbuffer + offset))); + this->current_recovery_number |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->current_recovery_number); + this->total_number_of_recoveries = ((uint16_t) (*(inbuffer + offset))); + this->total_number_of_recoveries |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->total_number_of_recoveries); + uint32_t length_recovery_behavior_name; + arrToVar(length_recovery_behavior_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_recovery_behavior_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_recovery_behavior_name-1]=0; + this->recovery_behavior_name = (char *)(inbuffer + offset-1); + offset += length_recovery_behavior_name; + return offset; + } + + virtual const char * getType() override { return "move_base_msgs/RecoveryStatus"; }; + virtual const char * getMD5() override { return "a2488e0805e1529a31044786ee1a2623"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/nav_msgs/SetMap.h b/pio_workspace/lib/ros_lib/nav_msgs/SetMap.h index f829f8c..db7f048 100644 --- a/pio_workspace/lib/ros_lib/nav_msgs/SetMap.h +++ b/pio_workspace/lib/ros_lib/nav_msgs/SetMap.h @@ -4,8 +4,8 @@ #include #include #include "ros/msg.h" -#include "geometry_msgs/PoseWithCovarianceStamped.h" #include "nav_msgs/OccupancyGrid.h" +#include "geometry_msgs/PoseWithCovarianceStamped.h" namespace nav_msgs { diff --git a/pio_workspace/lib/ros_lib/navfn/MakeNavPlan.h b/pio_workspace/lib/ros_lib/navfn/MakeNavPlan.h new file mode 100644 index 0000000..fe9661c --- /dev/null +++ b/pio_workspace/lib/ros_lib/navfn/MakeNavPlan.h @@ -0,0 +1,130 @@ +#ifndef _ROS_SERVICE_MakeNavPlan_h +#define _ROS_SERVICE_MakeNavPlan_h +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/PoseStamped.h" + +namespace navfn +{ + +static const char MAKENAVPLAN[] = "navfn/MakeNavPlan"; + + class MakeNavPlanRequest : public ros::Msg + { + public: + typedef geometry_msgs::PoseStamped _start_type; + _start_type start; + typedef geometry_msgs::PoseStamped _goal_type; + _goal_type goal; + + MakeNavPlanRequest(): + start(), + goal() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->start.serialize(outbuffer + offset); + offset += this->goal.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->start.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return MAKENAVPLAN; }; + virtual const char * getMD5() override { return "2fe3126bd5b2d56edd5005220333d4fd"; }; + + }; + + class MakeNavPlanResponse : public ros::Msg + { + public: + typedef uint8_t _plan_found_type; + _plan_found_type plan_found; + typedef const char* _error_message_type; + _error_message_type error_message; + uint32_t path_length; + typedef geometry_msgs::PoseStamped _path_type; + _path_type st_path; + _path_type * path; + + MakeNavPlanResponse(): + plan_found(0), + error_message(""), + path_length(0), st_path(), path(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->plan_found >> (8 * 0)) & 0xFF; + offset += sizeof(this->plan_found); + uint32_t length_error_message = strlen(this->error_message); + varToArr(outbuffer + offset, length_error_message); + offset += 4; + memcpy(outbuffer + offset, this->error_message, length_error_message); + offset += length_error_message; + *(outbuffer + offset + 0) = (this->path_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->path_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->path_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->path_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->path_length); + for( uint32_t i = 0; i < path_length; i++){ + offset += this->path[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->plan_found = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->plan_found); + uint32_t length_error_message; + arrToVar(length_error_message, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_error_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_error_message-1]=0; + this->error_message = (char *)(inbuffer + offset-1); + offset += length_error_message; + uint32_t path_lengthT = ((uint32_t) (*(inbuffer + offset))); + path_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + path_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + path_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->path_length); + if(path_lengthT > path_length) + this->path = (geometry_msgs::PoseStamped*)realloc(this->path, path_lengthT * sizeof(geometry_msgs::PoseStamped)); + path_length = path_lengthT; + for( uint32_t i = 0; i < path_length; i++){ + offset += this->st_path.deserialize(inbuffer + offset); + memcpy( &(this->path[i]), &(this->st_path), sizeof(geometry_msgs::PoseStamped)); + } + return offset; + } + + virtual const char * getType() override { return MAKENAVPLAN; }; + virtual const char * getMD5() override { return "8b8ed7edf1b237dc9ddda8c8ffed5d3a"; }; + + }; + + class MakeNavPlan { + public: + typedef MakeNavPlanRequest Request; + typedef MakeNavPlanResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/navfn/SetCostmap.h b/pio_workspace/lib/ros_lib/navfn/SetCostmap.h new file mode 100644 index 0000000..7646f6e --- /dev/null +++ b/pio_workspace/lib/ros_lib/navfn/SetCostmap.h @@ -0,0 +1,115 @@ +#ifndef _ROS_SERVICE_SetCostmap_h +#define _ROS_SERVICE_SetCostmap_h +#include +#include +#include +#include "ros/msg.h" + +namespace navfn +{ + +static const char SETCOSTMAP[] = "navfn/SetCostmap"; + + class SetCostmapRequest : public ros::Msg + { + public: + uint32_t costs_length; + typedef uint8_t _costs_type; + _costs_type st_costs; + _costs_type * costs; + typedef uint16_t _height_type; + _height_type height; + typedef uint16_t _width_type; + _width_type width; + + SetCostmapRequest(): + costs_length(0), st_costs(), costs(nullptr), + height(0), + width(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->costs_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->costs_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->costs_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->costs_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->costs_length); + for( uint32_t i = 0; i < costs_length; i++){ + *(outbuffer + offset + 0) = (this->costs[i] >> (8 * 0)) & 0xFF; + offset += sizeof(this->costs[i]); + } + *(outbuffer + offset + 0) = (this->height >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->height >> (8 * 1)) & 0xFF; + offset += sizeof(this->height); + *(outbuffer + offset + 0) = (this->width >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->width >> (8 * 1)) & 0xFF; + offset += sizeof(this->width); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t costs_lengthT = ((uint32_t) (*(inbuffer + offset))); + costs_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + costs_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + costs_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->costs_length); + if(costs_lengthT > costs_length) + this->costs = (uint8_t*)realloc(this->costs, costs_lengthT * sizeof(uint8_t)); + costs_length = costs_lengthT; + for( uint32_t i = 0; i < costs_length; i++){ + this->st_costs = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->st_costs); + memcpy( &(this->costs[i]), &(this->st_costs), sizeof(uint8_t)); + } + this->height = ((uint16_t) (*(inbuffer + offset))); + this->height |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->height); + this->width = ((uint16_t) (*(inbuffer + offset))); + this->width |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->width); + return offset; + } + + virtual const char * getType() override { return SETCOSTMAP; }; + virtual const char * getMD5() override { return "370ec969cdb71f9cde7c7cbe0d752308"; }; + + }; + + class SetCostmapResponse : public ros::Msg + { + public: + + SetCostmapResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + return offset; + } + + virtual const char * getType() override { return SETCOSTMAP; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class SetCostmap { + public: + typedef SetCostmapRequest Request; + typedef SetCostmapResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/octomap_msgs/BoundingBoxQuery.h b/pio_workspace/lib/ros_lib/octomap_msgs/BoundingBoxQuery.h new file mode 100644 index 0000000..c4e618a --- /dev/null +++ b/pio_workspace/lib/ros_lib/octomap_msgs/BoundingBoxQuery.h @@ -0,0 +1,81 @@ +#ifndef _ROS_SERVICE_BoundingBoxQuery_h +#define _ROS_SERVICE_BoundingBoxQuery_h +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Point.h" + +namespace octomap_msgs +{ + +static const char BOUNDINGBOXQUERY[] = "octomap_msgs/BoundingBoxQuery"; + + class BoundingBoxQueryRequest : public ros::Msg + { + public: + typedef geometry_msgs::Point _min_type; + _min_type min; + typedef geometry_msgs::Point _max_type; + _max_type max; + + BoundingBoxQueryRequest(): + min(), + max() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->min.serialize(outbuffer + offset); + offset += this->max.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->min.deserialize(inbuffer + offset); + offset += this->max.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return BOUNDINGBOXQUERY; }; + virtual const char * getMD5() override { return "93aa3d73b866f04880927745f4aab303"; }; + + }; + + class BoundingBoxQueryResponse : public ros::Msg + { + public: + + BoundingBoxQueryResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + return offset; + } + + virtual const char * getType() override { return BOUNDINGBOXQUERY; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class BoundingBoxQuery { + public: + typedef BoundingBoxQueryRequest Request; + typedef BoundingBoxQueryResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/octomap_msgs/GetOctomap.h b/pio_workspace/lib/ros_lib/octomap_msgs/GetOctomap.h new file mode 100644 index 0000000..5930321 --- /dev/null +++ b/pio_workspace/lib/ros_lib/octomap_msgs/GetOctomap.h @@ -0,0 +1,76 @@ +#ifndef _ROS_SERVICE_GetOctomap_h +#define _ROS_SERVICE_GetOctomap_h +#include +#include +#include +#include "ros/msg.h" +#include "octomap_msgs/Octomap.h" + +namespace octomap_msgs +{ + +static const char GETOCTOMAP[] = "octomap_msgs/GetOctomap"; + + class GetOctomapRequest : public ros::Msg + { + public: + + GetOctomapRequest() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + return offset; + } + + virtual const char * getType() override { return GETOCTOMAP; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class GetOctomapResponse : public ros::Msg + { + public: + typedef octomap_msgs::Octomap _map_type; + _map_type map; + + GetOctomapResponse(): + map() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->map.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->map.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return GETOCTOMAP; }; + virtual const char * getMD5() override { return "be9d2869d24fe40d6bc21ac21f6bb2c5"; }; + + }; + + class GetOctomap { + public: + typedef GetOctomapRequest Request; + typedef GetOctomapResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/octomap_msgs/Octomap.h b/pio_workspace/lib/ros_lib/octomap_msgs/Octomap.h new file mode 100644 index 0000000..09242b7 --- /dev/null +++ b/pio_workspace/lib/ros_lib/octomap_msgs/Octomap.h @@ -0,0 +1,122 @@ +#ifndef _ROS_octomap_msgs_Octomap_h +#define _ROS_octomap_msgs_Octomap_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace octomap_msgs +{ + + class Octomap : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef bool _binary_type; + _binary_type binary; + typedef const char* _id_type; + _id_type id; + typedef float _resolution_type; + _resolution_type resolution; + uint32_t data_length; + typedef int8_t _data_type; + _data_type st_data; + _data_type * data; + + Octomap(): + header(), + binary(0), + id(""), + resolution(0), + data_length(0), st_data(), data(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + union { + bool real; + uint8_t base; + } u_binary; + u_binary.real = this->binary; + *(outbuffer + offset + 0) = (u_binary.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->binary); + uint32_t length_id = strlen(this->id); + varToArr(outbuffer + offset, length_id); + offset += 4; + memcpy(outbuffer + offset, this->id, length_id); + offset += length_id; + offset += serializeAvrFloat64(outbuffer + offset, this->resolution); + *(outbuffer + offset + 0) = (this->data_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->data_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->data_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->data_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->data_length); + for( uint32_t i = 0; i < data_length; i++){ + union { + int8_t real; + uint8_t base; + } u_datai; + u_datai.real = this->data[i]; + *(outbuffer + offset + 0) = (u_datai.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + union { + bool real; + uint8_t base; + } u_binary; + u_binary.base = 0; + u_binary.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->binary = u_binary.real; + offset += sizeof(this->binary); + uint32_t length_id; + arrToVar(length_id, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_id-1]=0; + this->id = (char *)(inbuffer + offset-1); + offset += length_id; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->resolution)); + uint32_t data_lengthT = ((uint32_t) (*(inbuffer + offset))); + data_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + data_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + data_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->data_length); + if(data_lengthT > data_length) + this->data = (int8_t*)realloc(this->data, data_lengthT * sizeof(int8_t)); + data_length = data_lengthT; + for( uint32_t i = 0; i < data_length; i++){ + union { + int8_t real; + uint8_t base; + } u_st_data; + u_st_data.base = 0; + u_st_data.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->st_data = u_st_data.real; + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(int8_t)); + } + return offset; + } + + virtual const char * getType() override { return "octomap_msgs/Octomap"; }; + virtual const char * getMD5() override { return "9a45536b45c5e409cd49f04bb2d9999f"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/octomap_msgs/OctomapWithPose.h b/pio_workspace/lib/ros_lib/octomap_msgs/OctomapWithPose.h new file mode 100644 index 0000000..5799ea4 --- /dev/null +++ b/pio_workspace/lib/ros_lib/octomap_msgs/OctomapWithPose.h @@ -0,0 +1,56 @@ +#ifndef _ROS_octomap_msgs_OctomapWithPose_h +#define _ROS_octomap_msgs_OctomapWithPose_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Pose.h" +#include "octomap_msgs/Octomap.h" + +namespace octomap_msgs +{ + + class OctomapWithPose : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef geometry_msgs::Pose _origin_type; + _origin_type origin; + typedef octomap_msgs::Octomap _octomap_type; + _octomap_type octomap; + + OctomapWithPose(): + header(), + origin(), + octomap() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->origin.serialize(outbuffer + offset); + offset += this->octomap.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->origin.deserialize(inbuffer + offset); + offset += this->octomap.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "octomap_msgs/OctomapWithPose"; }; + virtual const char * getMD5() override { return "20b380aca6a508a657e95526cddaf618"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/polled_camera/GetPolledImage.h b/pio_workspace/lib/ros_lib/polled_camera/GetPolledImage.h deleted file mode 100644 index 0011042..0000000 --- a/pio_workspace/lib/ros_lib/polled_camera/GetPolledImage.h +++ /dev/null @@ -1,202 +0,0 @@ -#ifndef _ROS_SERVICE_GetPolledImage_h -#define _ROS_SERVICE_GetPolledImage_h -#include -#include -#include -#include "ros/msg.h" -#include "ros/duration.h" -#include "ros/time.h" -#include "sensor_msgs/RegionOfInterest.h" - -namespace polled_camera -{ - -static const char GETPOLLEDIMAGE[] = "polled_camera/GetPolledImage"; - - class GetPolledImageRequest : public ros::Msg - { - public: - typedef const char* _response_namespace_type; - _response_namespace_type response_namespace; - typedef ros::Duration _timeout_type; - _timeout_type timeout; - typedef uint32_t _binning_x_type; - _binning_x_type binning_x; - typedef uint32_t _binning_y_type; - _binning_y_type binning_y; - typedef sensor_msgs::RegionOfInterest _roi_type; - _roi_type roi; - - GetPolledImageRequest(): - response_namespace(""), - timeout(), - binning_x(0), - binning_y(0), - roi() - { - } - - virtual int serialize(unsigned char *outbuffer) const override - { - int offset = 0; - uint32_t length_response_namespace = strlen(this->response_namespace); - varToArr(outbuffer + offset, length_response_namespace); - offset += 4; - memcpy(outbuffer + offset, this->response_namespace, length_response_namespace); - offset += length_response_namespace; - *(outbuffer + offset + 0) = (this->timeout.sec >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (this->timeout.sec >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (this->timeout.sec >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (this->timeout.sec >> (8 * 3)) & 0xFF; - offset += sizeof(this->timeout.sec); - *(outbuffer + offset + 0) = (this->timeout.nsec >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (this->timeout.nsec >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (this->timeout.nsec >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (this->timeout.nsec >> (8 * 3)) & 0xFF; - offset += sizeof(this->timeout.nsec); - *(outbuffer + offset + 0) = (this->binning_x >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (this->binning_x >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (this->binning_x >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (this->binning_x >> (8 * 3)) & 0xFF; - offset += sizeof(this->binning_x); - *(outbuffer + offset + 0) = (this->binning_y >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (this->binning_y >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (this->binning_y >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (this->binning_y >> (8 * 3)) & 0xFF; - offset += sizeof(this->binning_y); - offset += this->roi.serialize(outbuffer + offset); - return offset; - } - - virtual int deserialize(unsigned char *inbuffer) override - { - int offset = 0; - uint32_t length_response_namespace; - arrToVar(length_response_namespace, (inbuffer + offset)); - offset += 4; - for(unsigned int k= offset; k< offset+length_response_namespace; ++k){ - inbuffer[k-1]=inbuffer[k]; - } - inbuffer[offset+length_response_namespace-1]=0; - this->response_namespace = (char *)(inbuffer + offset-1); - offset += length_response_namespace; - this->timeout.sec = ((uint32_t) (*(inbuffer + offset))); - this->timeout.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - this->timeout.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - this->timeout.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - offset += sizeof(this->timeout.sec); - this->timeout.nsec = ((uint32_t) (*(inbuffer + offset))); - this->timeout.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - this->timeout.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - this->timeout.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - offset += sizeof(this->timeout.nsec); - this->binning_x = ((uint32_t) (*(inbuffer + offset))); - this->binning_x |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - this->binning_x |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - this->binning_x |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - offset += sizeof(this->binning_x); - this->binning_y = ((uint32_t) (*(inbuffer + offset))); - this->binning_y |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - this->binning_y |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - this->binning_y |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - offset += sizeof(this->binning_y); - offset += this->roi.deserialize(inbuffer + offset); - return offset; - } - - virtual const char * getType() override { return GETPOLLEDIMAGE; }; - virtual const char * getMD5() override { return "c77ed43e530fd48e9e7a2a93845e154c"; }; - - }; - - class GetPolledImageResponse : public ros::Msg - { - public: - typedef bool _success_type; - _success_type success; - typedef const char* _status_message_type; - _status_message_type status_message; - typedef ros::Time _stamp_type; - _stamp_type stamp; - - GetPolledImageResponse(): - success(0), - status_message(""), - stamp() - { - } - - virtual int serialize(unsigned char *outbuffer) const override - { - int offset = 0; - union { - bool real; - uint8_t base; - } u_success; - u_success.real = this->success; - *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; - offset += sizeof(this->success); - uint32_t length_status_message = strlen(this->status_message); - varToArr(outbuffer + offset, length_status_message); - offset += 4; - memcpy(outbuffer + offset, this->status_message, length_status_message); - offset += length_status_message; - *(outbuffer + offset + 0) = (this->stamp.sec >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (this->stamp.sec >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (this->stamp.sec >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (this->stamp.sec >> (8 * 3)) & 0xFF; - offset += sizeof(this->stamp.sec); - *(outbuffer + offset + 0) = (this->stamp.nsec >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (this->stamp.nsec >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (this->stamp.nsec >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (this->stamp.nsec >> (8 * 3)) & 0xFF; - offset += sizeof(this->stamp.nsec); - return offset; - } - - virtual int deserialize(unsigned char *inbuffer) override - { - int offset = 0; - union { - bool real; - uint8_t base; - } u_success; - u_success.base = 0; - u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); - this->success = u_success.real; - offset += sizeof(this->success); - uint32_t length_status_message; - arrToVar(length_status_message, (inbuffer + offset)); - offset += 4; - for(unsigned int k= offset; k< offset+length_status_message; ++k){ - inbuffer[k-1]=inbuffer[k]; - } - inbuffer[offset+length_status_message-1]=0; - this->status_message = (char *)(inbuffer + offset-1); - offset += length_status_message; - this->stamp.sec = ((uint32_t) (*(inbuffer + offset))); - this->stamp.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - this->stamp.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - this->stamp.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - offset += sizeof(this->stamp.sec); - this->stamp.nsec = ((uint32_t) (*(inbuffer + offset))); - this->stamp.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - this->stamp.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - this->stamp.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - offset += sizeof(this->stamp.nsec); - return offset; - } - - virtual const char * getType() override { return GETPOLLEDIMAGE; }; - virtual const char * getMD5() override { return "dbf1f851bc511800e6129ccd5a3542ab"; }; - - }; - - class GetPolledImage { - public: - typedef GetPolledImageRequest Request; - typedef GetPolledImageResponse Response; - }; - -} -#endif diff --git a/pio_workspace/lib/ros_lib/realsense2_camera/DeviceInfo.h b/pio_workspace/lib/ros_lib/realsense2_camera/DeviceInfo.h new file mode 100644 index 0000000..4867227 --- /dev/null +++ b/pio_workspace/lib/ros_lib/realsense2_camera/DeviceInfo.h @@ -0,0 +1,172 @@ +#ifndef _ROS_SERVICE_DeviceInfo_h +#define _ROS_SERVICE_DeviceInfo_h +#include +#include +#include +#include "ros/msg.h" + +namespace realsense2_camera +{ + +static const char DEVICEINFO[] = "realsense2_camera/DeviceInfo"; + + class DeviceInfoRequest : public ros::Msg + { + public: + + DeviceInfoRequest() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + return offset; + } + + virtual const char * getType() override { return DEVICEINFO; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class DeviceInfoResponse : public ros::Msg + { + public: + typedef const char* _device_name_type; + _device_name_type device_name; + typedef const char* _serial_number_type; + _serial_number_type serial_number; + typedef const char* _firmware_version_type; + _firmware_version_type firmware_version; + typedef const char* _usb_type_descriptor_type; + _usb_type_descriptor_type usb_type_descriptor; + typedef const char* _firmware_update_id_type; + _firmware_update_id_type firmware_update_id; + typedef const char* _sensors_type; + _sensors_type sensors; + + DeviceInfoResponse(): + device_name(""), + serial_number(""), + firmware_version(""), + usb_type_descriptor(""), + firmware_update_id(""), + sensors("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_device_name = strlen(this->device_name); + varToArr(outbuffer + offset, length_device_name); + offset += 4; + memcpy(outbuffer + offset, this->device_name, length_device_name); + offset += length_device_name; + uint32_t length_serial_number = strlen(this->serial_number); + varToArr(outbuffer + offset, length_serial_number); + offset += 4; + memcpy(outbuffer + offset, this->serial_number, length_serial_number); + offset += length_serial_number; + uint32_t length_firmware_version = strlen(this->firmware_version); + varToArr(outbuffer + offset, length_firmware_version); + offset += 4; + memcpy(outbuffer + offset, this->firmware_version, length_firmware_version); + offset += length_firmware_version; + uint32_t length_usb_type_descriptor = strlen(this->usb_type_descriptor); + varToArr(outbuffer + offset, length_usb_type_descriptor); + offset += 4; + memcpy(outbuffer + offset, this->usb_type_descriptor, length_usb_type_descriptor); + offset += length_usb_type_descriptor; + uint32_t length_firmware_update_id = strlen(this->firmware_update_id); + varToArr(outbuffer + offset, length_firmware_update_id); + offset += 4; + memcpy(outbuffer + offset, this->firmware_update_id, length_firmware_update_id); + offset += length_firmware_update_id; + uint32_t length_sensors = strlen(this->sensors); + varToArr(outbuffer + offset, length_sensors); + offset += 4; + memcpy(outbuffer + offset, this->sensors, length_sensors); + offset += length_sensors; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_device_name; + arrToVar(length_device_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_device_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_device_name-1]=0; + this->device_name = (char *)(inbuffer + offset-1); + offset += length_device_name; + uint32_t length_serial_number; + arrToVar(length_serial_number, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_serial_number; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_serial_number-1]=0; + this->serial_number = (char *)(inbuffer + offset-1); + offset += length_serial_number; + uint32_t length_firmware_version; + arrToVar(length_firmware_version, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_firmware_version; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_firmware_version-1]=0; + this->firmware_version = (char *)(inbuffer + offset-1); + offset += length_firmware_version; + uint32_t length_usb_type_descriptor; + arrToVar(length_usb_type_descriptor, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_usb_type_descriptor; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_usb_type_descriptor-1]=0; + this->usb_type_descriptor = (char *)(inbuffer + offset-1); + offset += length_usb_type_descriptor; + uint32_t length_firmware_update_id; + arrToVar(length_firmware_update_id, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_firmware_update_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_firmware_update_id-1]=0; + this->firmware_update_id = (char *)(inbuffer + offset-1); + offset += length_firmware_update_id; + uint32_t length_sensors; + arrToVar(length_sensors, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_sensors; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_sensors-1]=0; + this->sensors = (char *)(inbuffer + offset-1); + offset += length_sensors; + return offset; + } + + virtual const char * getType() override { return DEVICEINFO; }; + virtual const char * getMD5() override { return "914e9cfa74a4f66f08c3fe1016943c1b"; }; + + }; + + class DeviceInfo { + public: + typedef DeviceInfoRequest Request; + typedef DeviceInfoResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/realsense2_camera/Extrinsics.h b/pio_workspace/lib/ros_lib/realsense2_camera/Extrinsics.h new file mode 100644 index 0000000..5896818 --- /dev/null +++ b/pio_workspace/lib/ros_lib/realsense2_camera/Extrinsics.h @@ -0,0 +1,60 @@ +#ifndef _ROS_realsense2_camera_Extrinsics_h +#define _ROS_realsense2_camera_Extrinsics_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace realsense2_camera +{ + + class Extrinsics : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + float rotation[9]; + float translation[3]; + + Extrinsics(): + header(), + rotation(), + translation() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + for( uint32_t i = 0; i < 9; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->rotation[i]); + } + for( uint32_t i = 0; i < 3; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->translation[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + for( uint32_t i = 0; i < 9; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->rotation[i])); + } + for( uint32_t i = 0; i < 3; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->translation[i])); + } + return offset; + } + + virtual const char * getType() override { return "realsense2_camera/Extrinsics"; }; + virtual const char * getMD5() override { return "3627b43073f4cd5dd6dc179a49eda2ad"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/realsense2_camera/IMUInfo.h b/pio_workspace/lib/ros_lib/realsense2_camera/IMUInfo.h new file mode 100644 index 0000000..38442d0 --- /dev/null +++ b/pio_workspace/lib/ros_lib/realsense2_camera/IMUInfo.h @@ -0,0 +1,79 @@ +#ifndef _ROS_realsense2_camera_IMUInfo_h +#define _ROS_realsense2_camera_IMUInfo_h + +#include +#include +#include +#include "ros/msg.h" + +namespace realsense2_camera +{ + + class IMUInfo : public ros::Msg + { + public: + typedef const char* _frame_id_type; + _frame_id_type frame_id; + float data[12]; + float noise_variances[3]; + float bias_variances[3]; + + IMUInfo(): + frame_id(""), + data(), + noise_variances(), + bias_variances() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_frame_id = strlen(this->frame_id); + varToArr(outbuffer + offset, length_frame_id); + offset += 4; + memcpy(outbuffer + offset, this->frame_id, length_frame_id); + offset += length_frame_id; + for( uint32_t i = 0; i < 12; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->data[i]); + } + for( uint32_t i = 0; i < 3; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->noise_variances[i]); + } + for( uint32_t i = 0; i < 3; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->bias_variances[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_frame_id; + arrToVar(length_frame_id, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_frame_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_frame_id-1]=0; + this->frame_id = (char *)(inbuffer + offset-1); + offset += length_frame_id; + for( uint32_t i = 0; i < 12; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->data[i])); + } + for( uint32_t i = 0; i < 3; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->noise_variances[i])); + } + for( uint32_t i = 0; i < 3; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->bias_variances[i])); + } + return offset; + } + + virtual const char * getType() override { return "realsense2_camera/IMUInfo"; }; + virtual const char * getMD5() override { return "a02adb3a99530b11ba18a16f40f9512a"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/realsense2_camera/Metadata.h b/pio_workspace/lib/ros_lib/realsense2_camera/Metadata.h new file mode 100644 index 0000000..01a7c42 --- /dev/null +++ b/pio_workspace/lib/ros_lib/realsense2_camera/Metadata.h @@ -0,0 +1,61 @@ +#ifndef _ROS_realsense2_camera_Metadata_h +#define _ROS_realsense2_camera_Metadata_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace realsense2_camera +{ + + class Metadata : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef const char* _json_data_type; + _json_data_type json_data; + + Metadata(): + header(), + json_data("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_json_data = strlen(this->json_data); + varToArr(outbuffer + offset, length_json_data); + offset += 4; + memcpy(outbuffer + offset, this->json_data, length_json_data); + offset += length_json_data; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_json_data; + arrToVar(length_json_data, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_json_data; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_json_data-1]=0; + this->json_data = (char *)(inbuffer + offset-1); + offset += length_json_data; + return offset; + } + + virtual const char * getType() override { return "realsense2_camera/Metadata"; }; + virtual const char * getMD5() override { return "4966ca002be16ee67fe4dbfb2f354787"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/robot_localization/FromLL.h b/pio_workspace/lib/ros_lib/robot_localization/FromLL.h new file mode 100644 index 0000000..e061e9c --- /dev/null +++ b/pio_workspace/lib/ros_lib/robot_localization/FromLL.h @@ -0,0 +1,82 @@ +#ifndef _ROS_SERVICE_FromLL_h +#define _ROS_SERVICE_FromLL_h +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Point.h" +#include "geographic_msgs/GeoPoint.h" + +namespace robot_localization +{ + +static const char FROMLL[] = "robot_localization/FromLL"; + + class FromLLRequest : public ros::Msg + { + public: + typedef geographic_msgs::GeoPoint _ll_point_type; + _ll_point_type ll_point; + + FromLLRequest(): + ll_point() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->ll_point.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->ll_point.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return FROMLL; }; + virtual const char * getMD5() override { return "191f0513cae6fcb95b63e2ec2e976938"; }; + + }; + + class FromLLResponse : public ros::Msg + { + public: + typedef geometry_msgs::Point _map_point_type; + _map_point_type map_point; + + FromLLResponse(): + map_point() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->map_point.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->map_point.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return FROMLL; }; + virtual const char * getMD5() override { return "326fc0ec1385c52a253c06e024d9f49e"; }; + + }; + + class FromLL { + public: + typedef FromLLRequest Request; + typedef FromLLResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/robot_localization/GetState.h b/pio_workspace/lib/ros_lib/robot_localization/GetState.h new file mode 100644 index 0000000..0f8f9c9 --- /dev/null +++ b/pio_workspace/lib/ros_lib/robot_localization/GetState.h @@ -0,0 +1,127 @@ +#ifndef _ROS_SERVICE_GetState_h +#define _ROS_SERVICE_GetState_h +#include +#include +#include +#include "ros/msg.h" +#include "ros/time.h" + +namespace robot_localization +{ + +static const char GETSTATE[] = "robot_localization/GetState"; + + class GetStateRequest : public ros::Msg + { + public: + typedef ros::Time _time_stamp_type; + _time_stamp_type time_stamp; + typedef const char* _frame_id_type; + _frame_id_type frame_id; + + GetStateRequest(): + time_stamp(), + frame_id("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->time_stamp.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->time_stamp.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->time_stamp.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->time_stamp.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->time_stamp.sec); + *(outbuffer + offset + 0) = (this->time_stamp.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->time_stamp.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->time_stamp.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->time_stamp.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->time_stamp.nsec); + uint32_t length_frame_id = strlen(this->frame_id); + varToArr(outbuffer + offset, length_frame_id); + offset += 4; + memcpy(outbuffer + offset, this->frame_id, length_frame_id); + offset += length_frame_id; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->time_stamp.sec = ((uint32_t) (*(inbuffer + offset))); + this->time_stamp.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->time_stamp.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->time_stamp.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->time_stamp.sec); + this->time_stamp.nsec = ((uint32_t) (*(inbuffer + offset))); + this->time_stamp.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->time_stamp.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->time_stamp.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->time_stamp.nsec); + uint32_t length_frame_id; + arrToVar(length_frame_id, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_frame_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_frame_id-1]=0; + this->frame_id = (char *)(inbuffer + offset-1); + offset += length_frame_id; + return offset; + } + + virtual const char * getType() override { return GETSTATE; }; + virtual const char * getMD5() override { return "853815113280ed7c4ea64ad795f27171"; }; + + }; + + class GetStateResponse : public ros::Msg + { + public: + float state[15]; + float covariance[225]; + + GetStateResponse(): + state(), + covariance() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + for( uint32_t i = 0; i < 15; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->state[i]); + } + for( uint32_t i = 0; i < 225; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->covariance[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + for( uint32_t i = 0; i < 15; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->state[i])); + } + for( uint32_t i = 0; i < 225; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->covariance[i])); + } + return offset; + } + + virtual const char * getType() override { return GETSTATE; }; + virtual const char * getMD5() override { return "8d49e6249cf8371736e3286b16a7ce83"; }; + + }; + + class GetState { + public: + typedef GetStateRequest Request; + typedef GetStateResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/robot_localization/SetDatum.h b/pio_workspace/lib/ros_lib/robot_localization/SetDatum.h new file mode 100644 index 0000000..b3ce76e --- /dev/null +++ b/pio_workspace/lib/ros_lib/robot_localization/SetDatum.h @@ -0,0 +1,76 @@ +#ifndef _ROS_SERVICE_SetDatum_h +#define _ROS_SERVICE_SetDatum_h +#include +#include +#include +#include "ros/msg.h" +#include "geographic_msgs/GeoPose.h" + +namespace robot_localization +{ + +static const char SETDATUM[] = "robot_localization/SetDatum"; + + class SetDatumRequest : public ros::Msg + { + public: + typedef geographic_msgs::GeoPose _geo_pose_type; + _geo_pose_type geo_pose; + + SetDatumRequest(): + geo_pose() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->geo_pose.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->geo_pose.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return SETDATUM; }; + virtual const char * getMD5() override { return "fe903ca95d0210defda73a1629604439"; }; + + }; + + class SetDatumResponse : public ros::Msg + { + public: + + SetDatumResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + return offset; + } + + virtual const char * getType() override { return SETDATUM; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class SetDatum { + public: + typedef SetDatumRequest Request; + typedef SetDatumResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/robot_localization/SetPose.h b/pio_workspace/lib/ros_lib/robot_localization/SetPose.h new file mode 100644 index 0000000..d516af2 --- /dev/null +++ b/pio_workspace/lib/ros_lib/robot_localization/SetPose.h @@ -0,0 +1,76 @@ +#ifndef _ROS_SERVICE_SetPose_h +#define _ROS_SERVICE_SetPose_h +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/PoseWithCovarianceStamped.h" + +namespace robot_localization +{ + +static const char SETPOSE[] = "robot_localization/SetPose"; + + class SetPoseRequest : public ros::Msg + { + public: + typedef geometry_msgs::PoseWithCovarianceStamped _pose_type; + _pose_type pose; + + SetPoseRequest(): + pose() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->pose.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->pose.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return SETPOSE; }; + virtual const char * getMD5() override { return "4f3e0bbe7a24e1f929488cd1970222d3"; }; + + }; + + class SetPoseResponse : public ros::Msg + { + public: + + SetPoseResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + return offset; + } + + virtual const char * getType() override { return SETPOSE; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class SetPose { + public: + typedef SetPoseRequest Request; + typedef SetPoseResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/robot_localization/SetUTMZone.h b/pio_workspace/lib/ros_lib/robot_localization/SetUTMZone.h new file mode 100644 index 0000000..c400fb7 --- /dev/null +++ b/pio_workspace/lib/ros_lib/robot_localization/SetUTMZone.h @@ -0,0 +1,87 @@ +#ifndef _ROS_SERVICE_SetUTMZone_h +#define _ROS_SERVICE_SetUTMZone_h +#include +#include +#include +#include "ros/msg.h" + +namespace robot_localization +{ + +static const char SETUTMZONE[] = "robot_localization/SetUTMZone"; + + class SetUTMZoneRequest : public ros::Msg + { + public: + typedef const char* _utm_zone_type; + _utm_zone_type utm_zone; + + SetUTMZoneRequest(): + utm_zone("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_utm_zone = strlen(this->utm_zone); + varToArr(outbuffer + offset, length_utm_zone); + offset += 4; + memcpy(outbuffer + offset, this->utm_zone, length_utm_zone); + offset += length_utm_zone; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_utm_zone; + arrToVar(length_utm_zone, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_utm_zone; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_utm_zone-1]=0; + this->utm_zone = (char *)(inbuffer + offset-1); + offset += length_utm_zone; + return offset; + } + + virtual const char * getType() override { return SETUTMZONE; }; + virtual const char * getMD5() override { return "893fd74d45efde020666acda18d3cccc"; }; + + }; + + class SetUTMZoneResponse : public ros::Msg + { + public: + + SetUTMZoneResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + return offset; + } + + virtual const char * getType() override { return SETUTMZONE; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class SetUTMZone { + public: + typedef SetUTMZoneRequest Request; + typedef SetUTMZoneResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/robot_localization/ToLL.h b/pio_workspace/lib/ros_lib/robot_localization/ToLL.h new file mode 100644 index 0000000..6ba7066 --- /dev/null +++ b/pio_workspace/lib/ros_lib/robot_localization/ToLL.h @@ -0,0 +1,82 @@ +#ifndef _ROS_SERVICE_ToLL_h +#define _ROS_SERVICE_ToLL_h +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Point.h" +#include "geographic_msgs/GeoPoint.h" + +namespace robot_localization +{ + +static const char TOLL[] = "robot_localization/ToLL"; + + class ToLLRequest : public ros::Msg + { + public: + typedef geometry_msgs::Point _map_point_type; + _map_point_type map_point; + + ToLLRequest(): + map_point() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->map_point.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->map_point.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return TOLL; }; + virtual const char * getMD5() override { return "326fc0ec1385c52a253c06e024d9f49e"; }; + + }; + + class ToLLResponse : public ros::Msg + { + public: + typedef geographic_msgs::GeoPoint _ll_point_type; + _ll_point_type ll_point; + + ToLLResponse(): + ll_point() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->ll_point.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->ll_point.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return TOLL; }; + virtual const char * getMD5() override { return "191f0513cae6fcb95b63e2ec2e976938"; }; + + }; + + class ToLL { + public: + typedef ToLLRequest Request; + typedef ToLLResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/robot_localization/ToggleFilterProcessing.h b/pio_workspace/lib/ros_lib/robot_localization/ToggleFilterProcessing.h new file mode 100644 index 0000000..a8b3439 --- /dev/null +++ b/pio_workspace/lib/ros_lib/robot_localization/ToggleFilterProcessing.h @@ -0,0 +1,106 @@ +#ifndef _ROS_SERVICE_ToggleFilterProcessing_h +#define _ROS_SERVICE_ToggleFilterProcessing_h +#include +#include +#include +#include "ros/msg.h" + +namespace robot_localization +{ + +static const char TOGGLEFILTERPROCESSING[] = "robot_localization/ToggleFilterProcessing"; + + class ToggleFilterProcessingRequest : public ros::Msg + { + public: + typedef bool _on_type; + _on_type on; + + ToggleFilterProcessingRequest(): + on(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_on; + u_on.real = this->on; + *(outbuffer + offset + 0) = (u_on.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->on); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_on; + u_on.base = 0; + u_on.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->on = u_on.real; + offset += sizeof(this->on); + return offset; + } + + virtual const char * getType() override { return TOGGLEFILTERPROCESSING; }; + virtual const char * getMD5() override { return "74983d2ffe4877de8ae30b7a94625c41"; }; + + }; + + class ToggleFilterProcessingResponse : public ros::Msg + { + public: + typedef bool _status_type; + _status_type status; + + ToggleFilterProcessingResponse(): + status(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_status; + u_status.real = this->status; + *(outbuffer + offset + 0) = (u_status.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->status); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_status; + u_status.base = 0; + u_status.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->status = u_status.real; + offset += sizeof(this->status); + return offset; + } + + virtual const char * getType() override { return TOGGLEFILTERPROCESSING; }; + virtual const char * getMD5() override { return "3a1255d4d998bd4d6585c64639b5ee9a"; }; + + }; + + class ToggleFilterProcessing { + public: + typedef ToggleFilterProcessingRequest Request; + typedef ToggleFilterProcessingResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/roscpp_tutorials/TwoInts.h b/pio_workspace/lib/ros_lib/roscpp_tutorials/TwoInts.h deleted file mode 100644 index 1ae3a17..0000000 --- a/pio_workspace/lib/ros_lib/roscpp_tutorials/TwoInts.h +++ /dev/null @@ -1,166 +0,0 @@ -#ifndef _ROS_SERVICE_TwoInts_h -#define _ROS_SERVICE_TwoInts_h -#include -#include -#include -#include "ros/msg.h" - -namespace roscpp_tutorials -{ - -static const char TWOINTS[] = "roscpp_tutorials/TwoInts"; - - class TwoIntsRequest : public ros::Msg - { - public: - typedef int64_t _a_type; - _a_type a; - typedef int64_t _b_type; - _b_type b; - - TwoIntsRequest(): - a(0), - b(0) - { - } - - virtual int serialize(unsigned char *outbuffer) const override - { - int offset = 0; - union { - int64_t real; - uint64_t base; - } u_a; - u_a.real = this->a; - *(outbuffer + offset + 0) = (u_a.base >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (u_a.base >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (u_a.base >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (u_a.base >> (8 * 3)) & 0xFF; - *(outbuffer + offset + 4) = (u_a.base >> (8 * 4)) & 0xFF; - *(outbuffer + offset + 5) = (u_a.base >> (8 * 5)) & 0xFF; - *(outbuffer + offset + 6) = (u_a.base >> (8 * 6)) & 0xFF; - *(outbuffer + offset + 7) = (u_a.base >> (8 * 7)) & 0xFF; - offset += sizeof(this->a); - union { - int64_t real; - uint64_t base; - } u_b; - u_b.real = this->b; - *(outbuffer + offset + 0) = (u_b.base >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (u_b.base >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (u_b.base >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (u_b.base >> (8 * 3)) & 0xFF; - *(outbuffer + offset + 4) = (u_b.base >> (8 * 4)) & 0xFF; - *(outbuffer + offset + 5) = (u_b.base >> (8 * 5)) & 0xFF; - *(outbuffer + offset + 6) = (u_b.base >> (8 * 6)) & 0xFF; - *(outbuffer + offset + 7) = (u_b.base >> (8 * 7)) & 0xFF; - offset += sizeof(this->b); - return offset; - } - - virtual int deserialize(unsigned char *inbuffer) override - { - int offset = 0; - union { - int64_t real; - uint64_t base; - } u_a; - u_a.base = 0; - u_a.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); - u_a.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); - u_a.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); - u_a.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); - u_a.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); - u_a.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); - u_a.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); - u_a.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); - this->a = u_a.real; - offset += sizeof(this->a); - union { - int64_t real; - uint64_t base; - } u_b; - u_b.base = 0; - u_b.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); - u_b.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); - u_b.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); - u_b.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); - u_b.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); - u_b.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); - u_b.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); - u_b.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); - this->b = u_b.real; - offset += sizeof(this->b); - return offset; - } - - virtual const char * getType() override { return TWOINTS; }; - virtual const char * getMD5() override { return "36d09b846be0b371c5f190354dd3153e"; }; - - }; - - class TwoIntsResponse : public ros::Msg - { - public: - typedef int64_t _sum_type; - _sum_type sum; - - TwoIntsResponse(): - sum(0) - { - } - - virtual int serialize(unsigned char *outbuffer) const override - { - int offset = 0; - union { - int64_t real; - uint64_t base; - } u_sum; - u_sum.real = this->sum; - *(outbuffer + offset + 0) = (u_sum.base >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (u_sum.base >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (u_sum.base >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (u_sum.base >> (8 * 3)) & 0xFF; - *(outbuffer + offset + 4) = (u_sum.base >> (8 * 4)) & 0xFF; - *(outbuffer + offset + 5) = (u_sum.base >> (8 * 5)) & 0xFF; - *(outbuffer + offset + 6) = (u_sum.base >> (8 * 6)) & 0xFF; - *(outbuffer + offset + 7) = (u_sum.base >> (8 * 7)) & 0xFF; - offset += sizeof(this->sum); - return offset; - } - - virtual int deserialize(unsigned char *inbuffer) override - { - int offset = 0; - union { - int64_t real; - uint64_t base; - } u_sum; - u_sum.base = 0; - u_sum.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); - u_sum.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); - u_sum.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); - u_sum.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); - u_sum.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); - u_sum.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); - u_sum.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); - u_sum.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); - this->sum = u_sum.real; - offset += sizeof(this->sum); - return offset; - } - - virtual const char * getType() override { return TWOINTS; }; - virtual const char * getMD5() override { return "b88405221c77b1878a3cbbfff53428d7"; }; - - }; - - class TwoInts { - public: - typedef TwoIntsRequest Request; - typedef TwoIntsResponse Response; - }; - -} -#endif diff --git a/pio_workspace/lib/ros_lib/rospy_tutorials/AddTwoInts.h b/pio_workspace/lib/ros_lib/rospy_tutorials/AddTwoInts.h deleted file mode 100644 index f02f833..0000000 --- a/pio_workspace/lib/ros_lib/rospy_tutorials/AddTwoInts.h +++ /dev/null @@ -1,166 +0,0 @@ -#ifndef _ROS_SERVICE_AddTwoInts_h -#define _ROS_SERVICE_AddTwoInts_h -#include -#include -#include -#include "ros/msg.h" - -namespace rospy_tutorials -{ - -static const char ADDTWOINTS[] = "rospy_tutorials/AddTwoInts"; - - class AddTwoIntsRequest : public ros::Msg - { - public: - typedef int64_t _a_type; - _a_type a; - typedef int64_t _b_type; - _b_type b; - - AddTwoIntsRequest(): - a(0), - b(0) - { - } - - virtual int serialize(unsigned char *outbuffer) const override - { - int offset = 0; - union { - int64_t real; - uint64_t base; - } u_a; - u_a.real = this->a; - *(outbuffer + offset + 0) = (u_a.base >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (u_a.base >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (u_a.base >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (u_a.base >> (8 * 3)) & 0xFF; - *(outbuffer + offset + 4) = (u_a.base >> (8 * 4)) & 0xFF; - *(outbuffer + offset + 5) = (u_a.base >> (8 * 5)) & 0xFF; - *(outbuffer + offset + 6) = (u_a.base >> (8 * 6)) & 0xFF; - *(outbuffer + offset + 7) = (u_a.base >> (8 * 7)) & 0xFF; - offset += sizeof(this->a); - union { - int64_t real; - uint64_t base; - } u_b; - u_b.real = this->b; - *(outbuffer + offset + 0) = (u_b.base >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (u_b.base >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (u_b.base >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (u_b.base >> (8 * 3)) & 0xFF; - *(outbuffer + offset + 4) = (u_b.base >> (8 * 4)) & 0xFF; - *(outbuffer + offset + 5) = (u_b.base >> (8 * 5)) & 0xFF; - *(outbuffer + offset + 6) = (u_b.base >> (8 * 6)) & 0xFF; - *(outbuffer + offset + 7) = (u_b.base >> (8 * 7)) & 0xFF; - offset += sizeof(this->b); - return offset; - } - - virtual int deserialize(unsigned char *inbuffer) override - { - int offset = 0; - union { - int64_t real; - uint64_t base; - } u_a; - u_a.base = 0; - u_a.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); - u_a.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); - u_a.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); - u_a.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); - u_a.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); - u_a.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); - u_a.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); - u_a.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); - this->a = u_a.real; - offset += sizeof(this->a); - union { - int64_t real; - uint64_t base; - } u_b; - u_b.base = 0; - u_b.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); - u_b.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); - u_b.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); - u_b.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); - u_b.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); - u_b.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); - u_b.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); - u_b.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); - this->b = u_b.real; - offset += sizeof(this->b); - return offset; - } - - virtual const char * getType() override { return ADDTWOINTS; }; - virtual const char * getMD5() override { return "36d09b846be0b371c5f190354dd3153e"; }; - - }; - - class AddTwoIntsResponse : public ros::Msg - { - public: - typedef int64_t _sum_type; - _sum_type sum; - - AddTwoIntsResponse(): - sum(0) - { - } - - virtual int serialize(unsigned char *outbuffer) const override - { - int offset = 0; - union { - int64_t real; - uint64_t base; - } u_sum; - u_sum.real = this->sum; - *(outbuffer + offset + 0) = (u_sum.base >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (u_sum.base >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (u_sum.base >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (u_sum.base >> (8 * 3)) & 0xFF; - *(outbuffer + offset + 4) = (u_sum.base >> (8 * 4)) & 0xFF; - *(outbuffer + offset + 5) = (u_sum.base >> (8 * 5)) & 0xFF; - *(outbuffer + offset + 6) = (u_sum.base >> (8 * 6)) & 0xFF; - *(outbuffer + offset + 7) = (u_sum.base >> (8 * 7)) & 0xFF; - offset += sizeof(this->sum); - return offset; - } - - virtual int deserialize(unsigned char *inbuffer) override - { - int offset = 0; - union { - int64_t real; - uint64_t base; - } u_sum; - u_sum.base = 0; - u_sum.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); - u_sum.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); - u_sum.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); - u_sum.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); - u_sum.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); - u_sum.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); - u_sum.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); - u_sum.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); - this->sum = u_sum.real; - offset += sizeof(this->sum); - return offset; - } - - virtual const char * getType() override { return ADDTWOINTS; }; - virtual const char * getMD5() override { return "b88405221c77b1878a3cbbfff53428d7"; }; - - }; - - class AddTwoInts { - public: - typedef AddTwoIntsRequest Request; - typedef AddTwoIntsResponse Response; - }; - -} -#endif diff --git a/pio_workspace/lib/ros_lib/rospy_tutorials/BadTwoInts.h b/pio_workspace/lib/ros_lib/rospy_tutorials/BadTwoInts.h deleted file mode 100644 index 24a449f..0000000 --- a/pio_workspace/lib/ros_lib/rospy_tutorials/BadTwoInts.h +++ /dev/null @@ -1,150 +0,0 @@ -#ifndef _ROS_SERVICE_BadTwoInts_h -#define _ROS_SERVICE_BadTwoInts_h -#include -#include -#include -#include "ros/msg.h" - -namespace rospy_tutorials -{ - -static const char BADTWOINTS[] = "rospy_tutorials/BadTwoInts"; - - class BadTwoIntsRequest : public ros::Msg - { - public: - typedef int64_t _a_type; - _a_type a; - typedef int32_t _b_type; - _b_type b; - - BadTwoIntsRequest(): - a(0), - b(0) - { - } - - virtual int serialize(unsigned char *outbuffer) const override - { - int offset = 0; - union { - int64_t real; - uint64_t base; - } u_a; - u_a.real = this->a; - *(outbuffer + offset + 0) = (u_a.base >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (u_a.base >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (u_a.base >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (u_a.base >> (8 * 3)) & 0xFF; - *(outbuffer + offset + 4) = (u_a.base >> (8 * 4)) & 0xFF; - *(outbuffer + offset + 5) = (u_a.base >> (8 * 5)) & 0xFF; - *(outbuffer + offset + 6) = (u_a.base >> (8 * 6)) & 0xFF; - *(outbuffer + offset + 7) = (u_a.base >> (8 * 7)) & 0xFF; - offset += sizeof(this->a); - union { - int32_t real; - uint32_t base; - } u_b; - u_b.real = this->b; - *(outbuffer + offset + 0) = (u_b.base >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (u_b.base >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (u_b.base >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (u_b.base >> (8 * 3)) & 0xFF; - offset += sizeof(this->b); - return offset; - } - - virtual int deserialize(unsigned char *inbuffer) override - { - int offset = 0; - union { - int64_t real; - uint64_t base; - } u_a; - u_a.base = 0; - u_a.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); - u_a.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); - u_a.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); - u_a.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); - u_a.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); - u_a.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); - u_a.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); - u_a.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); - this->a = u_a.real; - offset += sizeof(this->a); - union { - int32_t real; - uint32_t base; - } u_b; - u_b.base = 0; - u_b.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); - u_b.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - u_b.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - u_b.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - this->b = u_b.real; - offset += sizeof(this->b); - return offset; - } - - virtual const char * getType() override { return BADTWOINTS; }; - virtual const char * getMD5() override { return "29bb5c7dea8bf822f53e94b0ee5a3a56"; }; - - }; - - class BadTwoIntsResponse : public ros::Msg - { - public: - typedef int32_t _sum_type; - _sum_type sum; - - BadTwoIntsResponse(): - sum(0) - { - } - - virtual int serialize(unsigned char *outbuffer) const override - { - int offset = 0; - union { - int32_t real; - uint32_t base; - } u_sum; - u_sum.real = this->sum; - *(outbuffer + offset + 0) = (u_sum.base >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (u_sum.base >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (u_sum.base >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (u_sum.base >> (8 * 3)) & 0xFF; - offset += sizeof(this->sum); - return offset; - } - - virtual int deserialize(unsigned char *inbuffer) override - { - int offset = 0; - union { - int32_t real; - uint32_t base; - } u_sum; - u_sum.base = 0; - u_sum.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); - u_sum.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - u_sum.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - u_sum.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - this->sum = u_sum.real; - offset += sizeof(this->sum); - return offset; - } - - virtual const char * getType() override { return BADTWOINTS; }; - virtual const char * getMD5() override { return "0ba699c25c9418c0366f3595c0c8e8ec"; }; - - }; - - class BadTwoInts { - public: - typedef BadTwoIntsRequest Request; - typedef BadTwoIntsResponse Response; - }; - -} -#endif diff --git a/pio_workspace/lib/ros_lib/rospy_tutorials/HeaderString.h b/pio_workspace/lib/ros_lib/rospy_tutorials/HeaderString.h deleted file mode 100644 index 762014f..0000000 --- a/pio_workspace/lib/ros_lib/rospy_tutorials/HeaderString.h +++ /dev/null @@ -1,61 +0,0 @@ -#ifndef _ROS_rospy_tutorials_HeaderString_h -#define _ROS_rospy_tutorials_HeaderString_h - -#include -#include -#include -#include "ros/msg.h" -#include "std_msgs/Header.h" - -namespace rospy_tutorials -{ - - class HeaderString : public ros::Msg - { - public: - typedef std_msgs::Header _header_type; - _header_type header; - typedef const char* _data_type; - _data_type data; - - HeaderString(): - header(), - data("") - { - } - - virtual int serialize(unsigned char *outbuffer) const override - { - int offset = 0; - offset += this->header.serialize(outbuffer + offset); - uint32_t length_data = strlen(this->data); - varToArr(outbuffer + offset, length_data); - offset += 4; - memcpy(outbuffer + offset, this->data, length_data); - offset += length_data; - return offset; - } - - virtual int deserialize(unsigned char *inbuffer) override - { - int offset = 0; - offset += this->header.deserialize(inbuffer + offset); - uint32_t length_data; - arrToVar(length_data, (inbuffer + offset)); - offset += 4; - for(unsigned int k= offset; k< offset+length_data; ++k){ - inbuffer[k-1]=inbuffer[k]; - } - inbuffer[offset+length_data-1]=0; - this->data = (char *)(inbuffer + offset-1); - offset += length_data; - return offset; - } - - virtual const char * getType() override { return "rospy_tutorials/HeaderString"; }; - virtual const char * getMD5() override { return "c99a9440709e4d4a9716d55b8270d5e7"; }; - - }; - -} -#endif diff --git a/pio_workspace/lib/ros_lib/rtabmap_msgs/AddLink.h b/pio_workspace/lib/ros_lib/rtabmap_msgs/AddLink.h new file mode 100644 index 0000000..6cea573 --- /dev/null +++ b/pio_workspace/lib/ros_lib/rtabmap_msgs/AddLink.h @@ -0,0 +1,76 @@ +#ifndef _ROS_SERVICE_AddLink_h +#define _ROS_SERVICE_AddLink_h +#include +#include +#include +#include "ros/msg.h" +#include "rtabmap_msgs/Link.h" + +namespace rtabmap_msgs +{ + +static const char ADDLINK[] = "rtabmap_msgs/AddLink"; + + class AddLinkRequest : public ros::Msg + { + public: + typedef rtabmap_msgs::Link _link_type; + _link_type link; + + AddLinkRequest(): + link() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->link.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->link.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return ADDLINK; }; + virtual const char * getMD5() override { return "050728e3c25a15bf78d487d6aafab152"; }; + + }; + + class AddLinkResponse : public ros::Msg + { + public: + + AddLinkResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + return offset; + } + + virtual const char * getType() override { return ADDLINK; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class AddLink { + public: + typedef AddLinkRequest Request; + typedef AddLinkResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/rtabmap_msgs/CameraModel.h b/pio_workspace/lib/ros_lib/rtabmap_msgs/CameraModel.h new file mode 100644 index 0000000..4d3d9a5 --- /dev/null +++ b/pio_workspace/lib/ros_lib/rtabmap_msgs/CameraModel.h @@ -0,0 +1,50 @@ +#ifndef _ROS_rtabmap_msgs_CameraModel_h +#define _ROS_rtabmap_msgs_CameraModel_h + +#include +#include +#include +#include "ros/msg.h" +#include "sensor_msgs/CameraInfo.h" +#include "geometry_msgs/Transform.h" + +namespace rtabmap_msgs +{ + + class CameraModel : public ros::Msg + { + public: + typedef sensor_msgs::CameraInfo _camera_info_type; + _camera_info_type camera_info; + typedef geometry_msgs::Transform _local_transform_type; + _local_transform_type local_transform; + + CameraModel(): + camera_info(), + local_transform() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->camera_info.serialize(outbuffer + offset); + offset += this->local_transform.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->camera_info.deserialize(inbuffer + offset); + offset += this->local_transform.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "rtabmap_msgs/CameraModel"; }; + virtual const char * getMD5() override { return "f9352913302b569cfb34fd659fea4d7b"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/rtabmap_msgs/CameraModels.h b/pio_workspace/lib/ros_lib/rtabmap_msgs/CameraModels.h new file mode 100644 index 0000000..b10f2b6 --- /dev/null +++ b/pio_workspace/lib/ros_lib/rtabmap_msgs/CameraModels.h @@ -0,0 +1,64 @@ +#ifndef _ROS_rtabmap_msgs_CameraModels_h +#define _ROS_rtabmap_msgs_CameraModels_h + +#include +#include +#include +#include "ros/msg.h" +#include "rtabmap_msgs/CameraModel.h" + +namespace rtabmap_msgs +{ + + class CameraModels : public ros::Msg + { + public: + uint32_t models_length; + typedef rtabmap_msgs::CameraModel _models_type; + _models_type st_models; + _models_type * models; + + CameraModels(): + models_length(0), st_models(), models(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->models_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->models_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->models_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->models_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->models_length); + for( uint32_t i = 0; i < models_length; i++){ + offset += this->models[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t models_lengthT = ((uint32_t) (*(inbuffer + offset))); + models_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + models_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + models_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->models_length); + if(models_lengthT > models_length) + this->models = (rtabmap_msgs::CameraModel*)realloc(this->models, models_lengthT * sizeof(rtabmap_msgs::CameraModel)); + models_length = models_lengthT; + for( uint32_t i = 0; i < models_length; i++){ + offset += this->st_models.deserialize(inbuffer + offset); + memcpy( &(this->models[i]), &(this->st_models), sizeof(rtabmap_msgs::CameraModel)); + } + return offset; + } + + virtual const char * getType() override { return "rtabmap_msgs/CameraModels"; }; + virtual const char * getMD5() override { return "b9cc1f538c510301e1a2175d9d0ad481"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/rtabmap_msgs/CleanupLocalGrids.h b/pio_workspace/lib/ros_lib/rtabmap_msgs/CleanupLocalGrids.h new file mode 100644 index 0000000..db28aa7 --- /dev/null +++ b/pio_workspace/lib/ros_lib/rtabmap_msgs/CleanupLocalGrids.h @@ -0,0 +1,136 @@ +#ifndef _ROS_SERVICE_CleanupLocalGrids_h +#define _ROS_SERVICE_CleanupLocalGrids_h +#include +#include +#include +#include "ros/msg.h" + +namespace rtabmap_msgs +{ + +static const char CLEANUPLOCALGRIDS[] = "rtabmap_msgs/CleanupLocalGrids"; + + class CleanupLocalGridsRequest : public ros::Msg + { + public: + typedef int32_t _radius_type; + _radius_type radius; + typedef bool _filter_scans_type; + _filter_scans_type filter_scans; + + CleanupLocalGridsRequest(): + radius(0), + filter_scans(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_radius; + u_radius.real = this->radius; + *(outbuffer + offset + 0) = (u_radius.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_radius.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_radius.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_radius.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->radius); + union { + bool real; + uint8_t base; + } u_filter_scans; + u_filter_scans.real = this->filter_scans; + *(outbuffer + offset + 0) = (u_filter_scans.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->filter_scans); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_radius; + u_radius.base = 0; + u_radius.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_radius.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_radius.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_radius.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->radius = u_radius.real; + offset += sizeof(this->radius); + union { + bool real; + uint8_t base; + } u_filter_scans; + u_filter_scans.base = 0; + u_filter_scans.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->filter_scans = u_filter_scans.real; + offset += sizeof(this->filter_scans); + return offset; + } + + virtual const char * getType() override { return CLEANUPLOCALGRIDS; }; + virtual const char * getMD5() override { return "f7e9883a6b75c0ecc1bb1c33f3332f61"; }; + + }; + + class CleanupLocalGridsResponse : public ros::Msg + { + public: + typedef int32_t _modified_type; + _modified_type modified; + + CleanupLocalGridsResponse(): + modified(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_modified; + u_modified.real = this->modified; + *(outbuffer + offset + 0) = (u_modified.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_modified.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_modified.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_modified.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->modified); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_modified; + u_modified.base = 0; + u_modified.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_modified.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_modified.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_modified.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->modified = u_modified.real; + offset += sizeof(this->modified); + return offset; + } + + virtual const char * getType() override { return CLEANUPLOCALGRIDS; }; + virtual const char * getMD5() override { return "0079be4fbca49cb5090f065d768dbb2c"; }; + + }; + + class CleanupLocalGrids { + public: + typedef CleanupLocalGridsRequest Request; + typedef CleanupLocalGridsResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/rtabmap_msgs/DetectMoreLoopClosures.h b/pio_workspace/lib/ros_lib/rtabmap_msgs/DetectMoreLoopClosures.h new file mode 100644 index 0000000..419e42a --- /dev/null +++ b/pio_workspace/lib/ros_lib/rtabmap_msgs/DetectMoreLoopClosures.h @@ -0,0 +1,226 @@ +#ifndef _ROS_SERVICE_DetectMoreLoopClosures_h +#define _ROS_SERVICE_DetectMoreLoopClosures_h +#include +#include +#include +#include "ros/msg.h" + +namespace rtabmap_msgs +{ + +static const char DETECTMORELOOPCLOSURES[] = "rtabmap_msgs/DetectMoreLoopClosures"; + + class DetectMoreLoopClosuresRequest : public ros::Msg + { + public: + typedef float _cluster_radius_max_type; + _cluster_radius_max_type cluster_radius_max; + typedef float _cluster_radius_min_type; + _cluster_radius_min_type cluster_radius_min; + typedef float _cluster_angle_type; + _cluster_angle_type cluster_angle; + typedef int32_t _iterations_type; + _iterations_type iterations; + typedef bool _intra_only_type; + _intra_only_type intra_only; + typedef bool _inter_only_type; + _inter_only_type inter_only; + + DetectMoreLoopClosuresRequest(): + cluster_radius_max(0), + cluster_radius_min(0), + cluster_angle(0), + iterations(0), + intra_only(0), + inter_only(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + float real; + uint32_t base; + } u_cluster_radius_max; + u_cluster_radius_max.real = this->cluster_radius_max; + *(outbuffer + offset + 0) = (u_cluster_radius_max.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_cluster_radius_max.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_cluster_radius_max.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_cluster_radius_max.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->cluster_radius_max); + union { + float real; + uint32_t base; + } u_cluster_radius_min; + u_cluster_radius_min.real = this->cluster_radius_min; + *(outbuffer + offset + 0) = (u_cluster_radius_min.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_cluster_radius_min.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_cluster_radius_min.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_cluster_radius_min.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->cluster_radius_min); + union { + float real; + uint32_t base; + } u_cluster_angle; + u_cluster_angle.real = this->cluster_angle; + *(outbuffer + offset + 0) = (u_cluster_angle.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_cluster_angle.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_cluster_angle.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_cluster_angle.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->cluster_angle); + union { + int32_t real; + uint32_t base; + } u_iterations; + u_iterations.real = this->iterations; + *(outbuffer + offset + 0) = (u_iterations.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_iterations.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_iterations.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_iterations.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->iterations); + union { + bool real; + uint8_t base; + } u_intra_only; + u_intra_only.real = this->intra_only; + *(outbuffer + offset + 0) = (u_intra_only.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->intra_only); + union { + bool real; + uint8_t base; + } u_inter_only; + u_inter_only.real = this->inter_only; + *(outbuffer + offset + 0) = (u_inter_only.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->inter_only); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + float real; + uint32_t base; + } u_cluster_radius_max; + u_cluster_radius_max.base = 0; + u_cluster_radius_max.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_cluster_radius_max.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_cluster_radius_max.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_cluster_radius_max.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->cluster_radius_max = u_cluster_radius_max.real; + offset += sizeof(this->cluster_radius_max); + union { + float real; + uint32_t base; + } u_cluster_radius_min; + u_cluster_radius_min.base = 0; + u_cluster_radius_min.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_cluster_radius_min.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_cluster_radius_min.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_cluster_radius_min.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->cluster_radius_min = u_cluster_radius_min.real; + offset += sizeof(this->cluster_radius_min); + union { + float real; + uint32_t base; + } u_cluster_angle; + u_cluster_angle.base = 0; + u_cluster_angle.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_cluster_angle.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_cluster_angle.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_cluster_angle.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->cluster_angle = u_cluster_angle.real; + offset += sizeof(this->cluster_angle); + union { + int32_t real; + uint32_t base; + } u_iterations; + u_iterations.base = 0; + u_iterations.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_iterations.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_iterations.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_iterations.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->iterations = u_iterations.real; + offset += sizeof(this->iterations); + union { + bool real; + uint8_t base; + } u_intra_only; + u_intra_only.base = 0; + u_intra_only.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->intra_only = u_intra_only.real; + offset += sizeof(this->intra_only); + union { + bool real; + uint8_t base; + } u_inter_only; + u_inter_only.base = 0; + u_inter_only.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->inter_only = u_inter_only.real; + offset += sizeof(this->inter_only); + return offset; + } + + virtual const char * getType() override { return DETECTMORELOOPCLOSURES; }; + virtual const char * getMD5() override { return "df5cfe58cb7487b0d93ed1614efab4a3"; }; + + }; + + class DetectMoreLoopClosuresResponse : public ros::Msg + { + public: + typedef int32_t _detected_type; + _detected_type detected; + + DetectMoreLoopClosuresResponse(): + detected(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_detected; + u_detected.real = this->detected; + *(outbuffer + offset + 0) = (u_detected.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_detected.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_detected.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_detected.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->detected); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_detected; + u_detected.base = 0; + u_detected.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_detected.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_detected.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_detected.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->detected = u_detected.real; + offset += sizeof(this->detected); + return offset; + } + + virtual const char * getType() override { return DETECTMORELOOPCLOSURES; }; + virtual const char * getMD5() override { return "b915f91311c8f5d6b235ceb818d53f80"; }; + + }; + + class DetectMoreLoopClosures { + public: + typedef DetectMoreLoopClosuresRequest Request; + typedef DetectMoreLoopClosuresResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/rtabmap_msgs/EnvSensor.h b/pio_workspace/lib/ros_lib/rtabmap_msgs/EnvSensor.h new file mode 100644 index 0000000..6cd67f5 --- /dev/null +++ b/pio_workspace/lib/ros_lib/rtabmap_msgs/EnvSensor.h @@ -0,0 +1,73 @@ +#ifndef _ROS_rtabmap_msgs_EnvSensor_h +#define _ROS_rtabmap_msgs_EnvSensor_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace rtabmap_msgs +{ + + class EnvSensor : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef int32_t _type_type; + _type_type type; + typedef float _value_type; + _value_type value; + + EnvSensor(): + header(), + type(0), + value(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + union { + int32_t real; + uint32_t base; + } u_type; + u_type.real = this->type; + *(outbuffer + offset + 0) = (u_type.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_type.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_type.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_type.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->type); + offset += serializeAvrFloat64(outbuffer + offset, this->value); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + union { + int32_t real; + uint32_t base; + } u_type; + u_type.base = 0; + u_type.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_type.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_type.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_type.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->type = u_type.real; + offset += sizeof(this->type); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->value)); + return offset; + } + + virtual const char * getType() override { return "rtabmap_msgs/EnvSensor"; }; + virtual const char * getMD5() override { return "9df4dc52b9b74f3a81eaae9eecf9c0e0"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/rtabmap_msgs/GPS.h b/pio_workspace/lib/ros_lib/rtabmap_msgs/GPS.h new file mode 100644 index 0000000..3fb5a35 --- /dev/null +++ b/pio_workspace/lib/ros_lib/rtabmap_msgs/GPS.h @@ -0,0 +1,68 @@ +#ifndef _ROS_rtabmap_msgs_GPS_h +#define _ROS_rtabmap_msgs_GPS_h + +#include +#include +#include +#include "ros/msg.h" + +namespace rtabmap_msgs +{ + + class GPS : public ros::Msg + { + public: + typedef float _stamp_type; + _stamp_type stamp; + typedef float _longitude_type; + _longitude_type longitude; + typedef float _latitude_type; + _latitude_type latitude; + typedef float _altitude_type; + _altitude_type altitude; + typedef float _error_type; + _error_type error; + typedef float _bearing_type; + _bearing_type bearing; + + GPS(): + stamp(0), + longitude(0), + latitude(0), + altitude(0), + error(0), + bearing(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->stamp); + offset += serializeAvrFloat64(outbuffer + offset, this->longitude); + offset += serializeAvrFloat64(outbuffer + offset, this->latitude); + offset += serializeAvrFloat64(outbuffer + offset, this->altitude); + offset += serializeAvrFloat64(outbuffer + offset, this->error); + offset += serializeAvrFloat64(outbuffer + offset, this->bearing); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->stamp)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->longitude)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->latitude)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->altitude)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->error)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->bearing)); + return offset; + } + + virtual const char * getType() override { return "rtabmap_msgs/GPS"; }; + virtual const char * getMD5() override { return "0acde0d09a1ab74993cf4e41ff4eae49"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/rtabmap_msgs/GetMap.h b/pio_workspace/lib/ros_lib/rtabmap_msgs/GetMap.h new file mode 100644 index 0000000..0fd0532 --- /dev/null +++ b/pio_workspace/lib/ros_lib/rtabmap_msgs/GetMap.h @@ -0,0 +1,130 @@ +#ifndef _ROS_SERVICE_GetMap_h +#define _ROS_SERVICE_GetMap_h +#include +#include +#include +#include "ros/msg.h" +#include "rtabmap_msgs/MapData.h" + +namespace rtabmap_msgs +{ + +static const char GETMAP[] = "rtabmap_msgs/GetMap"; + + class GetMapRequest : public ros::Msg + { + public: + typedef bool _global_type; + _global_type global; + typedef bool _optimized_type; + _optimized_type optimized; + typedef bool _graphOnly_type; + _graphOnly_type graphOnly; + + GetMapRequest(): + global(0), + optimized(0), + graphOnly(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_global; + u_global.real = this->global; + *(outbuffer + offset + 0) = (u_global.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->global); + union { + bool real; + uint8_t base; + } u_optimized; + u_optimized.real = this->optimized; + *(outbuffer + offset + 0) = (u_optimized.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->optimized); + union { + bool real; + uint8_t base; + } u_graphOnly; + u_graphOnly.real = this->graphOnly; + *(outbuffer + offset + 0) = (u_graphOnly.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->graphOnly); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_global; + u_global.base = 0; + u_global.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->global = u_global.real; + offset += sizeof(this->global); + union { + bool real; + uint8_t base; + } u_optimized; + u_optimized.base = 0; + u_optimized.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->optimized = u_optimized.real; + offset += sizeof(this->optimized); + union { + bool real; + uint8_t base; + } u_graphOnly; + u_graphOnly.base = 0; + u_graphOnly.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->graphOnly = u_graphOnly.real; + offset += sizeof(this->graphOnly); + return offset; + } + + virtual const char * getType() override { return GETMAP; }; + virtual const char * getMD5() override { return "6213f9f13cced23f4d224b22f59d839c"; }; + + }; + + class GetMapResponse : public ros::Msg + { + public: + typedef rtabmap_msgs::MapData _data_type; + _data_type data; + + GetMapResponse(): + data() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->data.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->data.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return GETMAP; }; + virtual const char * getMD5() override { return "76e7e98705d080822083ef0a96245bb9"; }; + + }; + + class GetMap { + public: + typedef GetMapRequest Request; + typedef GetMapResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/rtabmap_msgs/GetMap2.h b/pio_workspace/lib/ros_lib/rtabmap_msgs/GetMap2.h new file mode 100644 index 0000000..f51c9dd --- /dev/null +++ b/pio_workspace/lib/ros_lib/rtabmap_msgs/GetMap2.h @@ -0,0 +1,220 @@ +#ifndef _ROS_SERVICE_GetMap2_h +#define _ROS_SERVICE_GetMap2_h +#include +#include +#include +#include "ros/msg.h" +#include "rtabmap_msgs/MapData.h" + +namespace rtabmap_msgs +{ + +static const char GETMAP2[] = "rtabmap_msgs/GetMap2"; + + class GetMap2Request : public ros::Msg + { + public: + typedef bool _global_type; + _global_type global; + typedef bool _optimized_type; + _optimized_type optimized; + typedef bool _with_images_type; + _with_images_type with_images; + typedef bool _with_scans_type; + _with_scans_type with_scans; + typedef bool _with_user_data_type; + _with_user_data_type with_user_data; + typedef bool _with_grids_type; + _with_grids_type with_grids; + typedef bool _with_words_type; + _with_words_type with_words; + typedef bool _with_global_descriptors_type; + _with_global_descriptors_type with_global_descriptors; + + GetMap2Request(): + global(0), + optimized(0), + with_images(0), + with_scans(0), + with_user_data(0), + with_grids(0), + with_words(0), + with_global_descriptors(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_global; + u_global.real = this->global; + *(outbuffer + offset + 0) = (u_global.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->global); + union { + bool real; + uint8_t base; + } u_optimized; + u_optimized.real = this->optimized; + *(outbuffer + offset + 0) = (u_optimized.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->optimized); + union { + bool real; + uint8_t base; + } u_with_images; + u_with_images.real = this->with_images; + *(outbuffer + offset + 0) = (u_with_images.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->with_images); + union { + bool real; + uint8_t base; + } u_with_scans; + u_with_scans.real = this->with_scans; + *(outbuffer + offset + 0) = (u_with_scans.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->with_scans); + union { + bool real; + uint8_t base; + } u_with_user_data; + u_with_user_data.real = this->with_user_data; + *(outbuffer + offset + 0) = (u_with_user_data.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->with_user_data); + union { + bool real; + uint8_t base; + } u_with_grids; + u_with_grids.real = this->with_grids; + *(outbuffer + offset + 0) = (u_with_grids.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->with_grids); + union { + bool real; + uint8_t base; + } u_with_words; + u_with_words.real = this->with_words; + *(outbuffer + offset + 0) = (u_with_words.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->with_words); + union { + bool real; + uint8_t base; + } u_with_global_descriptors; + u_with_global_descriptors.real = this->with_global_descriptors; + *(outbuffer + offset + 0) = (u_with_global_descriptors.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->with_global_descriptors); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_global; + u_global.base = 0; + u_global.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->global = u_global.real; + offset += sizeof(this->global); + union { + bool real; + uint8_t base; + } u_optimized; + u_optimized.base = 0; + u_optimized.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->optimized = u_optimized.real; + offset += sizeof(this->optimized); + union { + bool real; + uint8_t base; + } u_with_images; + u_with_images.base = 0; + u_with_images.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->with_images = u_with_images.real; + offset += sizeof(this->with_images); + union { + bool real; + uint8_t base; + } u_with_scans; + u_with_scans.base = 0; + u_with_scans.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->with_scans = u_with_scans.real; + offset += sizeof(this->with_scans); + union { + bool real; + uint8_t base; + } u_with_user_data; + u_with_user_data.base = 0; + u_with_user_data.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->with_user_data = u_with_user_data.real; + offset += sizeof(this->with_user_data); + union { + bool real; + uint8_t base; + } u_with_grids; + u_with_grids.base = 0; + u_with_grids.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->with_grids = u_with_grids.real; + offset += sizeof(this->with_grids); + union { + bool real; + uint8_t base; + } u_with_words; + u_with_words.base = 0; + u_with_words.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->with_words = u_with_words.real; + offset += sizeof(this->with_words); + union { + bool real; + uint8_t base; + } u_with_global_descriptors; + u_with_global_descriptors.base = 0; + u_with_global_descriptors.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->with_global_descriptors = u_with_global_descriptors.real; + offset += sizeof(this->with_global_descriptors); + return offset; + } + + virtual const char * getType() override { return GETMAP2; }; + virtual const char * getMD5() override { return "6c99a44d248df7f406229ae2372dab2e"; }; + + }; + + class GetMap2Response : public ros::Msg + { + public: + typedef rtabmap_msgs::MapData _data_type; + _data_type data; + + GetMap2Response(): + data() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->data.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->data.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return GETMAP2; }; + virtual const char * getMD5() override { return "76e7e98705d080822083ef0a96245bb9"; }; + + }; + + class GetMap2 { + public: + typedef GetMap2Request Request; + typedef GetMap2Response Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/rtabmap_msgs/GetNodeData.h b/pio_workspace/lib/ros_lib/rtabmap_msgs/GetNodeData.h new file mode 100644 index 0000000..a450443 --- /dev/null +++ b/pio_workspace/lib/ros_lib/rtabmap_msgs/GetNodeData.h @@ -0,0 +1,212 @@ +#ifndef _ROS_SERVICE_GetNodeData_h +#define _ROS_SERVICE_GetNodeData_h +#include +#include +#include +#include "ros/msg.h" +#include "rtabmap_msgs/Node.h" + +namespace rtabmap_msgs +{ + +static const char GETNODEDATA[] = "rtabmap_msgs/GetNodeData"; + + class GetNodeDataRequest : public ros::Msg + { + public: + uint32_t ids_length; + typedef int32_t _ids_type; + _ids_type st_ids; + _ids_type * ids; + typedef bool _images_type; + _images_type images; + typedef bool _scan_type; + _scan_type scan; + typedef bool _grid_type; + _grid_type grid; + typedef bool _user_data_type; + _user_data_type user_data; + + GetNodeDataRequest(): + ids_length(0), st_ids(), ids(nullptr), + images(0), + scan(0), + grid(0), + user_data(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->ids_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->ids_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->ids_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->ids_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->ids_length); + for( uint32_t i = 0; i < ids_length; i++){ + union { + int32_t real; + uint32_t base; + } u_idsi; + u_idsi.real = this->ids[i]; + *(outbuffer + offset + 0) = (u_idsi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_idsi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_idsi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_idsi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->ids[i]); + } + union { + bool real; + uint8_t base; + } u_images; + u_images.real = this->images; + *(outbuffer + offset + 0) = (u_images.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->images); + union { + bool real; + uint8_t base; + } u_scan; + u_scan.real = this->scan; + *(outbuffer + offset + 0) = (u_scan.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->scan); + union { + bool real; + uint8_t base; + } u_grid; + u_grid.real = this->grid; + *(outbuffer + offset + 0) = (u_grid.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->grid); + union { + bool real; + uint8_t base; + } u_user_data; + u_user_data.real = this->user_data; + *(outbuffer + offset + 0) = (u_user_data.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->user_data); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t ids_lengthT = ((uint32_t) (*(inbuffer + offset))); + ids_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + ids_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + ids_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->ids_length); + if(ids_lengthT > ids_length) + this->ids = (int32_t*)realloc(this->ids, ids_lengthT * sizeof(int32_t)); + ids_length = ids_lengthT; + for( uint32_t i = 0; i < ids_length; i++){ + union { + int32_t real; + uint32_t base; + } u_st_ids; + u_st_ids.base = 0; + u_st_ids.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_ids.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_ids.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_ids.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_ids = u_st_ids.real; + offset += sizeof(this->st_ids); + memcpy( &(this->ids[i]), &(this->st_ids), sizeof(int32_t)); + } + union { + bool real; + uint8_t base; + } u_images; + u_images.base = 0; + u_images.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->images = u_images.real; + offset += sizeof(this->images); + union { + bool real; + uint8_t base; + } u_scan; + u_scan.base = 0; + u_scan.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->scan = u_scan.real; + offset += sizeof(this->scan); + union { + bool real; + uint8_t base; + } u_grid; + u_grid.base = 0; + u_grid.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->grid = u_grid.real; + offset += sizeof(this->grid); + union { + bool real; + uint8_t base; + } u_user_data; + u_user_data.base = 0; + u_user_data.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->user_data = u_user_data.real; + offset += sizeof(this->user_data); + return offset; + } + + virtual const char * getType() override { return GETNODEDATA; }; + virtual const char * getMD5() override { return "0e8d18cf9b3249ab98f2d25e6071cc75"; }; + + }; + + class GetNodeDataResponse : public ros::Msg + { + public: + uint32_t data_length; + typedef rtabmap_msgs::Node _data_type; + _data_type st_data; + _data_type * data; + + GetNodeDataResponse(): + data_length(0), st_data(), data(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->data_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->data_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->data_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->data_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->data_length); + for( uint32_t i = 0; i < data_length; i++){ + offset += this->data[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t data_lengthT = ((uint32_t) (*(inbuffer + offset))); + data_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + data_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + data_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->data_length); + if(data_lengthT > data_length) + this->data = (rtabmap_msgs::Node*)realloc(this->data, data_lengthT * sizeof(rtabmap_msgs::Node)); + data_length = data_lengthT; + for( uint32_t i = 0; i < data_length; i++){ + offset += this->st_data.deserialize(inbuffer + offset); + memcpy( &(this->data[i]), &(this->st_data), sizeof(rtabmap_msgs::Node)); + } + return offset; + } + + virtual const char * getType() override { return GETNODEDATA; }; + virtual const char * getMD5() override { return "0eacd7dc712bd74cb0beddb338a1f77f"; }; + + }; + + class GetNodeData { + public: + typedef GetNodeDataRequest Request; + typedef GetNodeDataResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/rtabmap_msgs/GetNodesInRadius.h b/pio_workspace/lib/ros_lib/rtabmap_msgs/GetNodesInRadius.h new file mode 100644 index 0000000..31aa13e --- /dev/null +++ b/pio_workspace/lib/ros_lib/rtabmap_msgs/GetNodesInRadius.h @@ -0,0 +1,328 @@ +#ifndef _ROS_SERVICE_GetNodesInRadius_h +#define _ROS_SERVICE_GetNodesInRadius_h +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Pose.h" + +namespace rtabmap_msgs +{ + +static const char GETNODESINRADIUS[] = "rtabmap_msgs/GetNodesInRadius"; + + class GetNodesInRadiusRequest : public ros::Msg + { + public: + typedef int32_t _node_id_type; + _node_id_type node_id; + typedef float _x_type; + _x_type x; + typedef float _y_type; + _y_type y; + typedef float _z_type; + _z_type z; + typedef float _radius_type; + _radius_type radius; + typedef int32_t _k_type; + _k_type k; + + GetNodesInRadiusRequest(): + node_id(0), + x(0), + y(0), + z(0), + radius(0), + k(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_node_id; + u_node_id.real = this->node_id; + *(outbuffer + offset + 0) = (u_node_id.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_node_id.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_node_id.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_node_id.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->node_id); + union { + float real; + uint32_t base; + } u_x; + u_x.real = this->x; + *(outbuffer + offset + 0) = (u_x.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_x.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_x.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_x.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->x); + union { + float real; + uint32_t base; + } u_y; + u_y.real = this->y; + *(outbuffer + offset + 0) = (u_y.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_y.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_y.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_y.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->y); + union { + float real; + uint32_t base; + } u_z; + u_z.real = this->z; + *(outbuffer + offset + 0) = (u_z.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_z.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_z.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_z.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->z); + union { + float real; + uint32_t base; + } u_radius; + u_radius.real = this->radius; + *(outbuffer + offset + 0) = (u_radius.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_radius.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_radius.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_radius.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->radius); + union { + int32_t real; + uint32_t base; + } u_k; + u_k.real = this->k; + *(outbuffer + offset + 0) = (u_k.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_k.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_k.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_k.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->k); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_node_id; + u_node_id.base = 0; + u_node_id.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_node_id.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_node_id.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_node_id.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->node_id = u_node_id.real; + offset += sizeof(this->node_id); + union { + float real; + uint32_t base; + } u_x; + u_x.base = 0; + u_x.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->x = u_x.real; + offset += sizeof(this->x); + union { + float real; + uint32_t base; + } u_y; + u_y.base = 0; + u_y.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->y = u_y.real; + offset += sizeof(this->y); + union { + float real; + uint32_t base; + } u_z; + u_z.base = 0; + u_z.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_z.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_z.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_z.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->z = u_z.real; + offset += sizeof(this->z); + union { + float real; + uint32_t base; + } u_radius; + u_radius.base = 0; + u_radius.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_radius.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_radius.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_radius.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->radius = u_radius.real; + offset += sizeof(this->radius); + union { + int32_t real; + uint32_t base; + } u_k; + u_k.base = 0; + u_k.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_k.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_k.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_k.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->k = u_k.real; + offset += sizeof(this->k); + return offset; + } + + virtual const char * getType() override { return GETNODESINRADIUS; }; + virtual const char * getMD5() override { return "5e28a28a199cb5232f355c12c5a65418"; }; + + }; + + class GetNodesInRadiusResponse : public ros::Msg + { + public: + uint32_t ids_length; + typedef int32_t _ids_type; + _ids_type st_ids; + _ids_type * ids; + uint32_t poses_length; + typedef geometry_msgs::Pose _poses_type; + _poses_type st_poses; + _poses_type * poses; + uint32_t distsSqr_length; + typedef float _distsSqr_type; + _distsSqr_type st_distsSqr; + _distsSqr_type * distsSqr; + + GetNodesInRadiusResponse(): + ids_length(0), st_ids(), ids(nullptr), + poses_length(0), st_poses(), poses(nullptr), + distsSqr_length(0), st_distsSqr(), distsSqr(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->ids_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->ids_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->ids_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->ids_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->ids_length); + for( uint32_t i = 0; i < ids_length; i++){ + union { + int32_t real; + uint32_t base; + } u_idsi; + u_idsi.real = this->ids[i]; + *(outbuffer + offset + 0) = (u_idsi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_idsi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_idsi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_idsi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->ids[i]); + } + *(outbuffer + offset + 0) = (this->poses_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->poses_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->poses_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->poses_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->poses_length); + for( uint32_t i = 0; i < poses_length; i++){ + offset += this->poses[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->distsSqr_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->distsSqr_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->distsSqr_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->distsSqr_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->distsSqr_length); + for( uint32_t i = 0; i < distsSqr_length; i++){ + union { + float real; + uint32_t base; + } u_distsSqri; + u_distsSqri.real = this->distsSqr[i]; + *(outbuffer + offset + 0) = (u_distsSqri.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_distsSqri.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_distsSqri.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_distsSqri.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->distsSqr[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t ids_lengthT = ((uint32_t) (*(inbuffer + offset))); + ids_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + ids_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + ids_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->ids_length); + if(ids_lengthT > ids_length) + this->ids = (int32_t*)realloc(this->ids, ids_lengthT * sizeof(int32_t)); + ids_length = ids_lengthT; + for( uint32_t i = 0; i < ids_length; i++){ + union { + int32_t real; + uint32_t base; + } u_st_ids; + u_st_ids.base = 0; + u_st_ids.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_ids.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_ids.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_ids.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_ids = u_st_ids.real; + offset += sizeof(this->st_ids); + memcpy( &(this->ids[i]), &(this->st_ids), sizeof(int32_t)); + } + uint32_t poses_lengthT = ((uint32_t) (*(inbuffer + offset))); + poses_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + poses_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + poses_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->poses_length); + if(poses_lengthT > poses_length) + this->poses = (geometry_msgs::Pose*)realloc(this->poses, poses_lengthT * sizeof(geometry_msgs::Pose)); + poses_length = poses_lengthT; + for( uint32_t i = 0; i < poses_length; i++){ + offset += this->st_poses.deserialize(inbuffer + offset); + memcpy( &(this->poses[i]), &(this->st_poses), sizeof(geometry_msgs::Pose)); + } + uint32_t distsSqr_lengthT = ((uint32_t) (*(inbuffer + offset))); + distsSqr_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + distsSqr_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + distsSqr_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->distsSqr_length); + if(distsSqr_lengthT > distsSqr_length) + this->distsSqr = (float*)realloc(this->distsSqr, distsSqr_lengthT * sizeof(float)); + distsSqr_length = distsSqr_lengthT; + for( uint32_t i = 0; i < distsSqr_length; i++){ + union { + float real; + uint32_t base; + } u_st_distsSqr; + u_st_distsSqr.base = 0; + u_st_distsSqr.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_distsSqr.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_distsSqr.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_distsSqr.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_distsSqr = u_st_distsSqr.real; + offset += sizeof(this->st_distsSqr); + memcpy( &(this->distsSqr[i]), &(this->st_distsSqr), sizeof(float)); + } + return offset; + } + + virtual const char * getType() override { return GETNODESINRADIUS; }; + virtual const char * getMD5() override { return "1b8b2d45b8ca77eac8d3c9b89916ddbf"; }; + + }; + + class GetNodesInRadius { + public: + typedef GetNodesInRadiusRequest Request; + typedef GetNodesInRadiusResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/rtabmap_msgs/GetPlan.h b/pio_workspace/lib/ros_lib/rtabmap_msgs/GetPlan.h new file mode 100644 index 0000000..889b753 --- /dev/null +++ b/pio_workspace/lib/ros_lib/rtabmap_msgs/GetPlan.h @@ -0,0 +1,130 @@ +#ifndef _ROS_SERVICE_GetPlan_h +#define _ROS_SERVICE_GetPlan_h +#include +#include +#include +#include "ros/msg.h" +#include "rtabmap_msgs/Path.h" +#include "geometry_msgs/PoseStamped.h" + +namespace rtabmap_msgs +{ + +static const char GETPLAN[] = "rtabmap_msgs/GetPlan"; + + class GetPlanRequest : public ros::Msg + { + public: + typedef int32_t _goal_node_type; + _goal_node_type goal_node; + typedef geometry_msgs::PoseStamped _goal_type; + _goal_type goal; + typedef float _tolerance_type; + _tolerance_type tolerance; + + GetPlanRequest(): + goal_node(0), + goal(), + tolerance(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_goal_node; + u_goal_node.real = this->goal_node; + *(outbuffer + offset + 0) = (u_goal_node.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_goal_node.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_goal_node.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_goal_node.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->goal_node); + offset += this->goal.serialize(outbuffer + offset); + union { + float real; + uint32_t base; + } u_tolerance; + u_tolerance.real = this->tolerance; + *(outbuffer + offset + 0) = (u_tolerance.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_tolerance.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_tolerance.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_tolerance.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->tolerance); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_goal_node; + u_goal_node.base = 0; + u_goal_node.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_goal_node.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_goal_node.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_goal_node.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->goal_node = u_goal_node.real; + offset += sizeof(this->goal_node); + offset += this->goal.deserialize(inbuffer + offset); + union { + float real; + uint32_t base; + } u_tolerance; + u_tolerance.base = 0; + u_tolerance.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_tolerance.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_tolerance.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_tolerance.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->tolerance = u_tolerance.real; + offset += sizeof(this->tolerance); + return offset; + } + + virtual const char * getType() override { return GETPLAN; }; + virtual const char * getMD5() override { return "93cea387b2aa9245414c000574ff1591"; }; + + }; + + class GetPlanResponse : public ros::Msg + { + public: + typedef rtabmap_msgs::Path _plan_type; + _plan_type plan; + + GetPlanResponse(): + plan() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->plan.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->plan.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return GETPLAN; }; + virtual const char * getMD5() override { return "0412b9858bfcee4b2ee4fbf2f8eb5028"; }; + + }; + + class GetPlan { + public: + typedef GetPlanRequest Request; + typedef GetPlanResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/rtabmap_msgs/GlobalBundleAdjustment.h b/pio_workspace/lib/ros_lib/rtabmap_msgs/GlobalBundleAdjustment.h new file mode 100644 index 0000000..cfb97cd --- /dev/null +++ b/pio_workspace/lib/ros_lib/rtabmap_msgs/GlobalBundleAdjustment.h @@ -0,0 +1,160 @@ +#ifndef _ROS_SERVICE_GlobalBundleAdjustment_h +#define _ROS_SERVICE_GlobalBundleAdjustment_h +#include +#include +#include +#include "ros/msg.h" + +namespace rtabmap_msgs +{ + +static const char GLOBALBUNDLEADJUSTMENT[] = "rtabmap_msgs/GlobalBundleAdjustment"; + + class GlobalBundleAdjustmentRequest : public ros::Msg + { + public: + typedef int32_t _type_type; + _type_type type; + typedef int32_t _iterations_type; + _iterations_type iterations; + typedef float _pixel_variance_type; + _pixel_variance_type pixel_variance; + typedef bool _voc_matches_type; + _voc_matches_type voc_matches; + + GlobalBundleAdjustmentRequest(): + type(0), + iterations(0), + pixel_variance(0), + voc_matches(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_type; + u_type.real = this->type; + *(outbuffer + offset + 0) = (u_type.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_type.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_type.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_type.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->type); + union { + int32_t real; + uint32_t base; + } u_iterations; + u_iterations.real = this->iterations; + *(outbuffer + offset + 0) = (u_iterations.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_iterations.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_iterations.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_iterations.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->iterations); + union { + float real; + uint32_t base; + } u_pixel_variance; + u_pixel_variance.real = this->pixel_variance; + *(outbuffer + offset + 0) = (u_pixel_variance.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_pixel_variance.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_pixel_variance.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_pixel_variance.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->pixel_variance); + union { + bool real; + uint8_t base; + } u_voc_matches; + u_voc_matches.real = this->voc_matches; + *(outbuffer + offset + 0) = (u_voc_matches.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->voc_matches); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_type; + u_type.base = 0; + u_type.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_type.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_type.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_type.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->type = u_type.real; + offset += sizeof(this->type); + union { + int32_t real; + uint32_t base; + } u_iterations; + u_iterations.base = 0; + u_iterations.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_iterations.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_iterations.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_iterations.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->iterations = u_iterations.real; + offset += sizeof(this->iterations); + union { + float real; + uint32_t base; + } u_pixel_variance; + u_pixel_variance.base = 0; + u_pixel_variance.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_pixel_variance.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_pixel_variance.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_pixel_variance.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->pixel_variance = u_pixel_variance.real; + offset += sizeof(this->pixel_variance); + union { + bool real; + uint8_t base; + } u_voc_matches; + u_voc_matches.base = 0; + u_voc_matches.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->voc_matches = u_voc_matches.real; + offset += sizeof(this->voc_matches); + return offset; + } + + virtual const char * getType() override { return GLOBALBUNDLEADJUSTMENT; }; + virtual const char * getMD5() override { return "2e1ed640ba9f481fdaa2226734d70674"; }; + + }; + + class GlobalBundleAdjustmentResponse : public ros::Msg + { + public: + + GlobalBundleAdjustmentResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + return offset; + } + + virtual const char * getType() override { return GLOBALBUNDLEADJUSTMENT; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class GlobalBundleAdjustment { + public: + typedef GlobalBundleAdjustmentRequest Request; + typedef GlobalBundleAdjustmentResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/rtabmap_msgs/GlobalDescriptor.h b/pio_workspace/lib/ros_lib/rtabmap_msgs/GlobalDescriptor.h new file mode 100644 index 0000000..1e1f4ef --- /dev/null +++ b/pio_workspace/lib/ros_lib/rtabmap_msgs/GlobalDescriptor.h @@ -0,0 +1,122 @@ +#ifndef _ROS_rtabmap_msgs_GlobalDescriptor_h +#define _ROS_rtabmap_msgs_GlobalDescriptor_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace rtabmap_msgs +{ + + class GlobalDescriptor : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef int32_t _type_type; + _type_type type; + uint32_t info_length; + typedef uint8_t _info_type; + _info_type st_info; + _info_type * info; + uint32_t data_length; + typedef uint8_t _data_type; + _data_type st_data; + _data_type * data; + + GlobalDescriptor(): + header(), + type(0), + info_length(0), st_info(), info(nullptr), + data_length(0), st_data(), data(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + union { + int32_t real; + uint32_t base; + } u_type; + u_type.real = this->type; + *(outbuffer + offset + 0) = (u_type.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_type.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_type.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_type.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->type); + *(outbuffer + offset + 0) = (this->info_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->info_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->info_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->info_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->info_length); + for( uint32_t i = 0; i < info_length; i++){ + *(outbuffer + offset + 0) = (this->info[i] >> (8 * 0)) & 0xFF; + offset += sizeof(this->info[i]); + } + *(outbuffer + offset + 0) = (this->data_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->data_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->data_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->data_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->data_length); + for( uint32_t i = 0; i < data_length; i++){ + *(outbuffer + offset + 0) = (this->data[i] >> (8 * 0)) & 0xFF; + offset += sizeof(this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + union { + int32_t real; + uint32_t base; + } u_type; + u_type.base = 0; + u_type.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_type.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_type.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_type.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->type = u_type.real; + offset += sizeof(this->type); + uint32_t info_lengthT = ((uint32_t) (*(inbuffer + offset))); + info_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + info_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + info_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->info_length); + if(info_lengthT > info_length) + this->info = (uint8_t*)realloc(this->info, info_lengthT * sizeof(uint8_t)); + info_length = info_lengthT; + for( uint32_t i = 0; i < info_length; i++){ + this->st_info = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->st_info); + memcpy( &(this->info[i]), &(this->st_info), sizeof(uint8_t)); + } + uint32_t data_lengthT = ((uint32_t) (*(inbuffer + offset))); + data_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + data_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + data_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->data_length); + if(data_lengthT > data_length) + this->data = (uint8_t*)realloc(this->data, data_lengthT * sizeof(uint8_t)); + data_length = data_lengthT; + for( uint32_t i = 0; i < data_length; i++){ + this->st_data = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(uint8_t)); + } + return offset; + } + + virtual const char * getType() override { return "rtabmap_msgs/GlobalDescriptor"; }; + virtual const char * getMD5() override { return "cea16e5cbeb4de779e68853766f4772e"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/rtabmap_msgs/Goal.h b/pio_workspace/lib/ros_lib/rtabmap_msgs/Goal.h new file mode 100644 index 0000000..2b67c01 --- /dev/null +++ b/pio_workspace/lib/ros_lib/rtabmap_msgs/Goal.h @@ -0,0 +1,102 @@ +#ifndef _ROS_rtabmap_msgs_Goal_h +#define _ROS_rtabmap_msgs_Goal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace rtabmap_msgs +{ + + class Goal : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef int32_t _node_id_type; + _node_id_type node_id; + typedef const char* _node_label_type; + _node_label_type node_label; + typedef const char* _frame_id_type; + _frame_id_type frame_id; + + Goal(): + header(), + node_id(0), + node_label(""), + frame_id("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + union { + int32_t real; + uint32_t base; + } u_node_id; + u_node_id.real = this->node_id; + *(outbuffer + offset + 0) = (u_node_id.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_node_id.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_node_id.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_node_id.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->node_id); + uint32_t length_node_label = strlen(this->node_label); + varToArr(outbuffer + offset, length_node_label); + offset += 4; + memcpy(outbuffer + offset, this->node_label, length_node_label); + offset += length_node_label; + uint32_t length_frame_id = strlen(this->frame_id); + varToArr(outbuffer + offset, length_frame_id); + offset += 4; + memcpy(outbuffer + offset, this->frame_id, length_frame_id); + offset += length_frame_id; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + union { + int32_t real; + uint32_t base; + } u_node_id; + u_node_id.base = 0; + u_node_id.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_node_id.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_node_id.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_node_id.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->node_id = u_node_id.real; + offset += sizeof(this->node_id); + uint32_t length_node_label; + arrToVar(length_node_label, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_node_label; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_node_label-1]=0; + this->node_label = (char *)(inbuffer + offset-1); + offset += length_node_label; + uint32_t length_frame_id; + arrToVar(length_frame_id, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_frame_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_frame_id-1]=0; + this->frame_id = (char *)(inbuffer + offset-1); + offset += length_frame_id; + return offset; + } + + virtual const char * getType() override { return "rtabmap_msgs/Goal"; }; + virtual const char * getMD5() override { return "70f8a16a321d4ec76904a9989a8798b7"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/rtabmap_msgs/Info.h b/pio_workspace/lib/ros_lib/rtabmap_msgs/Info.h new file mode 100644 index 0000000..c7e5b02 --- /dev/null +++ b/pio_workspace/lib/ros_lib/rtabmap_msgs/Info.h @@ -0,0 +1,778 @@ +#ifndef _ROS_rtabmap_msgs_Info_h +#define _ROS_rtabmap_msgs_Info_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Transform.h" +#include "rtabmap_msgs/MapGraph.h" + +namespace rtabmap_msgs +{ + + class Info : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef int32_t _refId_type; + _refId_type refId; + typedef int32_t _loopClosureId_type; + _loopClosureId_type loopClosureId; + typedef int32_t _proximityDetectionId_type; + _proximityDetectionId_type proximityDetectionId; + typedef int32_t _landmarkId_type; + _landmarkId_type landmarkId; + typedef geometry_msgs::Transform _loopClosureTransform_type; + _loopClosureTransform_type loopClosureTransform; + uint32_t wmState_length; + typedef int32_t _wmState_type; + _wmState_type st_wmState; + _wmState_type * wmState; + uint32_t posteriorKeys_length; + typedef int32_t _posteriorKeys_type; + _posteriorKeys_type st_posteriorKeys; + _posteriorKeys_type * posteriorKeys; + uint32_t posteriorValues_length; + typedef float _posteriorValues_type; + _posteriorValues_type st_posteriorValues; + _posteriorValues_type * posteriorValues; + uint32_t likelihoodKeys_length; + typedef int32_t _likelihoodKeys_type; + _likelihoodKeys_type st_likelihoodKeys; + _likelihoodKeys_type * likelihoodKeys; + uint32_t likelihoodValues_length; + typedef float _likelihoodValues_type; + _likelihoodValues_type st_likelihoodValues; + _likelihoodValues_type * likelihoodValues; + uint32_t rawLikelihoodKeys_length; + typedef int32_t _rawLikelihoodKeys_type; + _rawLikelihoodKeys_type st_rawLikelihoodKeys; + _rawLikelihoodKeys_type * rawLikelihoodKeys; + uint32_t rawLikelihoodValues_length; + typedef float _rawLikelihoodValues_type; + _rawLikelihoodValues_type st_rawLikelihoodValues; + _rawLikelihoodValues_type * rawLikelihoodValues; + uint32_t weightsKeys_length; + typedef int32_t _weightsKeys_type; + _weightsKeys_type st_weightsKeys; + _weightsKeys_type * weightsKeys; + uint32_t weightsValues_length; + typedef int32_t _weightsValues_type; + _weightsValues_type st_weightsValues; + _weightsValues_type * weightsValues; + uint32_t labelsKeys_length; + typedef int32_t _labelsKeys_type; + _labelsKeys_type st_labelsKeys; + _labelsKeys_type * labelsKeys; + uint32_t labelsValues_length; + typedef char* _labelsValues_type; + _labelsValues_type st_labelsValues; + _labelsValues_type * labelsValues; + uint32_t statsKeys_length; + typedef char* _statsKeys_type; + _statsKeys_type st_statsKeys; + _statsKeys_type * statsKeys; + uint32_t statsValues_length; + typedef float _statsValues_type; + _statsValues_type st_statsValues; + _statsValues_type * statsValues; + uint32_t localPath_length; + typedef int32_t _localPath_type; + _localPath_type st_localPath; + _localPath_type * localPath; + typedef int32_t _currentGoalId_type; + _currentGoalId_type currentGoalId; + typedef rtabmap_msgs::MapGraph _odom_cache_type; + _odom_cache_type odom_cache; + + Info(): + header(), + refId(0), + loopClosureId(0), + proximityDetectionId(0), + landmarkId(0), + loopClosureTransform(), + wmState_length(0), st_wmState(), wmState(nullptr), + posteriorKeys_length(0), st_posteriorKeys(), posteriorKeys(nullptr), + posteriorValues_length(0), st_posteriorValues(), posteriorValues(nullptr), + likelihoodKeys_length(0), st_likelihoodKeys(), likelihoodKeys(nullptr), + likelihoodValues_length(0), st_likelihoodValues(), likelihoodValues(nullptr), + rawLikelihoodKeys_length(0), st_rawLikelihoodKeys(), rawLikelihoodKeys(nullptr), + rawLikelihoodValues_length(0), st_rawLikelihoodValues(), rawLikelihoodValues(nullptr), + weightsKeys_length(0), st_weightsKeys(), weightsKeys(nullptr), + weightsValues_length(0), st_weightsValues(), weightsValues(nullptr), + labelsKeys_length(0), st_labelsKeys(), labelsKeys(nullptr), + labelsValues_length(0), st_labelsValues(), labelsValues(nullptr), + statsKeys_length(0), st_statsKeys(), statsKeys(nullptr), + statsValues_length(0), st_statsValues(), statsValues(nullptr), + localPath_length(0), st_localPath(), localPath(nullptr), + currentGoalId(0), + odom_cache() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + union { + int32_t real; + uint32_t base; + } u_refId; + u_refId.real = this->refId; + *(outbuffer + offset + 0) = (u_refId.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_refId.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_refId.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_refId.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->refId); + union { + int32_t real; + uint32_t base; + } u_loopClosureId; + u_loopClosureId.real = this->loopClosureId; + *(outbuffer + offset + 0) = (u_loopClosureId.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_loopClosureId.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_loopClosureId.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_loopClosureId.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->loopClosureId); + union { + int32_t real; + uint32_t base; + } u_proximityDetectionId; + u_proximityDetectionId.real = this->proximityDetectionId; + *(outbuffer + offset + 0) = (u_proximityDetectionId.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_proximityDetectionId.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_proximityDetectionId.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_proximityDetectionId.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->proximityDetectionId); + union { + int32_t real; + uint32_t base; + } u_landmarkId; + u_landmarkId.real = this->landmarkId; + *(outbuffer + offset + 0) = (u_landmarkId.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_landmarkId.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_landmarkId.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_landmarkId.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->landmarkId); + offset += this->loopClosureTransform.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->wmState_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->wmState_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->wmState_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->wmState_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->wmState_length); + for( uint32_t i = 0; i < wmState_length; i++){ + union { + int32_t real; + uint32_t base; + } u_wmStatei; + u_wmStatei.real = this->wmState[i]; + *(outbuffer + offset + 0) = (u_wmStatei.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_wmStatei.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_wmStatei.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_wmStatei.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->wmState[i]); + } + *(outbuffer + offset + 0) = (this->posteriorKeys_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->posteriorKeys_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->posteriorKeys_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->posteriorKeys_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->posteriorKeys_length); + for( uint32_t i = 0; i < posteriorKeys_length; i++){ + union { + int32_t real; + uint32_t base; + } u_posteriorKeysi; + u_posteriorKeysi.real = this->posteriorKeys[i]; + *(outbuffer + offset + 0) = (u_posteriorKeysi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_posteriorKeysi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_posteriorKeysi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_posteriorKeysi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->posteriorKeys[i]); + } + *(outbuffer + offset + 0) = (this->posteriorValues_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->posteriorValues_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->posteriorValues_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->posteriorValues_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->posteriorValues_length); + for( uint32_t i = 0; i < posteriorValues_length; i++){ + union { + float real; + uint32_t base; + } u_posteriorValuesi; + u_posteriorValuesi.real = this->posteriorValues[i]; + *(outbuffer + offset + 0) = (u_posteriorValuesi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_posteriorValuesi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_posteriorValuesi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_posteriorValuesi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->posteriorValues[i]); + } + *(outbuffer + offset + 0) = (this->likelihoodKeys_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->likelihoodKeys_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->likelihoodKeys_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->likelihoodKeys_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->likelihoodKeys_length); + for( uint32_t i = 0; i < likelihoodKeys_length; i++){ + union { + int32_t real; + uint32_t base; + } u_likelihoodKeysi; + u_likelihoodKeysi.real = this->likelihoodKeys[i]; + *(outbuffer + offset + 0) = (u_likelihoodKeysi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_likelihoodKeysi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_likelihoodKeysi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_likelihoodKeysi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->likelihoodKeys[i]); + } + *(outbuffer + offset + 0) = (this->likelihoodValues_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->likelihoodValues_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->likelihoodValues_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->likelihoodValues_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->likelihoodValues_length); + for( uint32_t i = 0; i < likelihoodValues_length; i++){ + union { + float real; + uint32_t base; + } u_likelihoodValuesi; + u_likelihoodValuesi.real = this->likelihoodValues[i]; + *(outbuffer + offset + 0) = (u_likelihoodValuesi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_likelihoodValuesi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_likelihoodValuesi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_likelihoodValuesi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->likelihoodValues[i]); + } + *(outbuffer + offset + 0) = (this->rawLikelihoodKeys_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->rawLikelihoodKeys_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->rawLikelihoodKeys_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->rawLikelihoodKeys_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->rawLikelihoodKeys_length); + for( uint32_t i = 0; i < rawLikelihoodKeys_length; i++){ + union { + int32_t real; + uint32_t base; + } u_rawLikelihoodKeysi; + u_rawLikelihoodKeysi.real = this->rawLikelihoodKeys[i]; + *(outbuffer + offset + 0) = (u_rawLikelihoodKeysi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_rawLikelihoodKeysi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_rawLikelihoodKeysi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_rawLikelihoodKeysi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->rawLikelihoodKeys[i]); + } + *(outbuffer + offset + 0) = (this->rawLikelihoodValues_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->rawLikelihoodValues_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->rawLikelihoodValues_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->rawLikelihoodValues_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->rawLikelihoodValues_length); + for( uint32_t i = 0; i < rawLikelihoodValues_length; i++){ + union { + float real; + uint32_t base; + } u_rawLikelihoodValuesi; + u_rawLikelihoodValuesi.real = this->rawLikelihoodValues[i]; + *(outbuffer + offset + 0) = (u_rawLikelihoodValuesi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_rawLikelihoodValuesi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_rawLikelihoodValuesi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_rawLikelihoodValuesi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->rawLikelihoodValues[i]); + } + *(outbuffer + offset + 0) = (this->weightsKeys_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->weightsKeys_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->weightsKeys_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->weightsKeys_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->weightsKeys_length); + for( uint32_t i = 0; i < weightsKeys_length; i++){ + union { + int32_t real; + uint32_t base; + } u_weightsKeysi; + u_weightsKeysi.real = this->weightsKeys[i]; + *(outbuffer + offset + 0) = (u_weightsKeysi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_weightsKeysi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_weightsKeysi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_weightsKeysi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->weightsKeys[i]); + } + *(outbuffer + offset + 0) = (this->weightsValues_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->weightsValues_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->weightsValues_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->weightsValues_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->weightsValues_length); + for( uint32_t i = 0; i < weightsValues_length; i++){ + union { + int32_t real; + uint32_t base; + } u_weightsValuesi; + u_weightsValuesi.real = this->weightsValues[i]; + *(outbuffer + offset + 0) = (u_weightsValuesi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_weightsValuesi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_weightsValuesi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_weightsValuesi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->weightsValues[i]); + } + *(outbuffer + offset + 0) = (this->labelsKeys_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->labelsKeys_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->labelsKeys_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->labelsKeys_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->labelsKeys_length); + for( uint32_t i = 0; i < labelsKeys_length; i++){ + union { + int32_t real; + uint32_t base; + } u_labelsKeysi; + u_labelsKeysi.real = this->labelsKeys[i]; + *(outbuffer + offset + 0) = (u_labelsKeysi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_labelsKeysi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_labelsKeysi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_labelsKeysi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->labelsKeys[i]); + } + *(outbuffer + offset + 0) = (this->labelsValues_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->labelsValues_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->labelsValues_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->labelsValues_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->labelsValues_length); + for( uint32_t i = 0; i < labelsValues_length; i++){ + uint32_t length_labelsValuesi = strlen(this->labelsValues[i]); + varToArr(outbuffer + offset, length_labelsValuesi); + offset += 4; + memcpy(outbuffer + offset, this->labelsValues[i], length_labelsValuesi); + offset += length_labelsValuesi; + } + *(outbuffer + offset + 0) = (this->statsKeys_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->statsKeys_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->statsKeys_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->statsKeys_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->statsKeys_length); + for( uint32_t i = 0; i < statsKeys_length; i++){ + uint32_t length_statsKeysi = strlen(this->statsKeys[i]); + varToArr(outbuffer + offset, length_statsKeysi); + offset += 4; + memcpy(outbuffer + offset, this->statsKeys[i], length_statsKeysi); + offset += length_statsKeysi; + } + *(outbuffer + offset + 0) = (this->statsValues_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->statsValues_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->statsValues_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->statsValues_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->statsValues_length); + for( uint32_t i = 0; i < statsValues_length; i++){ + union { + float real; + uint32_t base; + } u_statsValuesi; + u_statsValuesi.real = this->statsValues[i]; + *(outbuffer + offset + 0) = (u_statsValuesi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_statsValuesi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_statsValuesi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_statsValuesi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->statsValues[i]); + } + *(outbuffer + offset + 0) = (this->localPath_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->localPath_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->localPath_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->localPath_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->localPath_length); + for( uint32_t i = 0; i < localPath_length; i++){ + union { + int32_t real; + uint32_t base; + } u_localPathi; + u_localPathi.real = this->localPath[i]; + *(outbuffer + offset + 0) = (u_localPathi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_localPathi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_localPathi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_localPathi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->localPath[i]); + } + union { + int32_t real; + uint32_t base; + } u_currentGoalId; + u_currentGoalId.real = this->currentGoalId; + *(outbuffer + offset + 0) = (u_currentGoalId.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_currentGoalId.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_currentGoalId.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_currentGoalId.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->currentGoalId); + offset += this->odom_cache.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + union { + int32_t real; + uint32_t base; + } u_refId; + u_refId.base = 0; + u_refId.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_refId.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_refId.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_refId.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->refId = u_refId.real; + offset += sizeof(this->refId); + union { + int32_t real; + uint32_t base; + } u_loopClosureId; + u_loopClosureId.base = 0; + u_loopClosureId.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_loopClosureId.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_loopClosureId.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_loopClosureId.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->loopClosureId = u_loopClosureId.real; + offset += sizeof(this->loopClosureId); + union { + int32_t real; + uint32_t base; + } u_proximityDetectionId; + u_proximityDetectionId.base = 0; + u_proximityDetectionId.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_proximityDetectionId.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_proximityDetectionId.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_proximityDetectionId.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->proximityDetectionId = u_proximityDetectionId.real; + offset += sizeof(this->proximityDetectionId); + union { + int32_t real; + uint32_t base; + } u_landmarkId; + u_landmarkId.base = 0; + u_landmarkId.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_landmarkId.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_landmarkId.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_landmarkId.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->landmarkId = u_landmarkId.real; + offset += sizeof(this->landmarkId); + offset += this->loopClosureTransform.deserialize(inbuffer + offset); + uint32_t wmState_lengthT = ((uint32_t) (*(inbuffer + offset))); + wmState_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + wmState_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + wmState_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->wmState_length); + if(wmState_lengthT > wmState_length) + this->wmState = (int32_t*)realloc(this->wmState, wmState_lengthT * sizeof(int32_t)); + wmState_length = wmState_lengthT; + for( uint32_t i = 0; i < wmState_length; i++){ + union { + int32_t real; + uint32_t base; + } u_st_wmState; + u_st_wmState.base = 0; + u_st_wmState.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_wmState.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_wmState.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_wmState.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_wmState = u_st_wmState.real; + offset += sizeof(this->st_wmState); + memcpy( &(this->wmState[i]), &(this->st_wmState), sizeof(int32_t)); + } + uint32_t posteriorKeys_lengthT = ((uint32_t) (*(inbuffer + offset))); + posteriorKeys_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + posteriorKeys_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + posteriorKeys_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->posteriorKeys_length); + if(posteriorKeys_lengthT > posteriorKeys_length) + this->posteriorKeys = (int32_t*)realloc(this->posteriorKeys, posteriorKeys_lengthT * sizeof(int32_t)); + posteriorKeys_length = posteriorKeys_lengthT; + for( uint32_t i = 0; i < posteriorKeys_length; i++){ + union { + int32_t real; + uint32_t base; + } u_st_posteriorKeys; + u_st_posteriorKeys.base = 0; + u_st_posteriorKeys.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_posteriorKeys.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_posteriorKeys.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_posteriorKeys.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_posteriorKeys = u_st_posteriorKeys.real; + offset += sizeof(this->st_posteriorKeys); + memcpy( &(this->posteriorKeys[i]), &(this->st_posteriorKeys), sizeof(int32_t)); + } + uint32_t posteriorValues_lengthT = ((uint32_t) (*(inbuffer + offset))); + posteriorValues_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + posteriorValues_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + posteriorValues_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->posteriorValues_length); + if(posteriorValues_lengthT > posteriorValues_length) + this->posteriorValues = (float*)realloc(this->posteriorValues, posteriorValues_lengthT * sizeof(float)); + posteriorValues_length = posteriorValues_lengthT; + for( uint32_t i = 0; i < posteriorValues_length; i++){ + union { + float real; + uint32_t base; + } u_st_posteriorValues; + u_st_posteriorValues.base = 0; + u_st_posteriorValues.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_posteriorValues.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_posteriorValues.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_posteriorValues.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_posteriorValues = u_st_posteriorValues.real; + offset += sizeof(this->st_posteriorValues); + memcpy( &(this->posteriorValues[i]), &(this->st_posteriorValues), sizeof(float)); + } + uint32_t likelihoodKeys_lengthT = ((uint32_t) (*(inbuffer + offset))); + likelihoodKeys_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + likelihoodKeys_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + likelihoodKeys_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->likelihoodKeys_length); + if(likelihoodKeys_lengthT > likelihoodKeys_length) + this->likelihoodKeys = (int32_t*)realloc(this->likelihoodKeys, likelihoodKeys_lengthT * sizeof(int32_t)); + likelihoodKeys_length = likelihoodKeys_lengthT; + for( uint32_t i = 0; i < likelihoodKeys_length; i++){ + union { + int32_t real; + uint32_t base; + } u_st_likelihoodKeys; + u_st_likelihoodKeys.base = 0; + u_st_likelihoodKeys.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_likelihoodKeys.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_likelihoodKeys.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_likelihoodKeys.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_likelihoodKeys = u_st_likelihoodKeys.real; + offset += sizeof(this->st_likelihoodKeys); + memcpy( &(this->likelihoodKeys[i]), &(this->st_likelihoodKeys), sizeof(int32_t)); + } + uint32_t likelihoodValues_lengthT = ((uint32_t) (*(inbuffer + offset))); + likelihoodValues_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + likelihoodValues_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + likelihoodValues_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->likelihoodValues_length); + if(likelihoodValues_lengthT > likelihoodValues_length) + this->likelihoodValues = (float*)realloc(this->likelihoodValues, likelihoodValues_lengthT * sizeof(float)); + likelihoodValues_length = likelihoodValues_lengthT; + for( uint32_t i = 0; i < likelihoodValues_length; i++){ + union { + float real; + uint32_t base; + } u_st_likelihoodValues; + u_st_likelihoodValues.base = 0; + u_st_likelihoodValues.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_likelihoodValues.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_likelihoodValues.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_likelihoodValues.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_likelihoodValues = u_st_likelihoodValues.real; + offset += sizeof(this->st_likelihoodValues); + memcpy( &(this->likelihoodValues[i]), &(this->st_likelihoodValues), sizeof(float)); + } + uint32_t rawLikelihoodKeys_lengthT = ((uint32_t) (*(inbuffer + offset))); + rawLikelihoodKeys_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + rawLikelihoodKeys_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + rawLikelihoodKeys_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->rawLikelihoodKeys_length); + if(rawLikelihoodKeys_lengthT > rawLikelihoodKeys_length) + this->rawLikelihoodKeys = (int32_t*)realloc(this->rawLikelihoodKeys, rawLikelihoodKeys_lengthT * sizeof(int32_t)); + rawLikelihoodKeys_length = rawLikelihoodKeys_lengthT; + for( uint32_t i = 0; i < rawLikelihoodKeys_length; i++){ + union { + int32_t real; + uint32_t base; + } u_st_rawLikelihoodKeys; + u_st_rawLikelihoodKeys.base = 0; + u_st_rawLikelihoodKeys.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_rawLikelihoodKeys.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_rawLikelihoodKeys.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_rawLikelihoodKeys.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_rawLikelihoodKeys = u_st_rawLikelihoodKeys.real; + offset += sizeof(this->st_rawLikelihoodKeys); + memcpy( &(this->rawLikelihoodKeys[i]), &(this->st_rawLikelihoodKeys), sizeof(int32_t)); + } + uint32_t rawLikelihoodValues_lengthT = ((uint32_t) (*(inbuffer + offset))); + rawLikelihoodValues_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + rawLikelihoodValues_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + rawLikelihoodValues_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->rawLikelihoodValues_length); + if(rawLikelihoodValues_lengthT > rawLikelihoodValues_length) + this->rawLikelihoodValues = (float*)realloc(this->rawLikelihoodValues, rawLikelihoodValues_lengthT * sizeof(float)); + rawLikelihoodValues_length = rawLikelihoodValues_lengthT; + for( uint32_t i = 0; i < rawLikelihoodValues_length; i++){ + union { + float real; + uint32_t base; + } u_st_rawLikelihoodValues; + u_st_rawLikelihoodValues.base = 0; + u_st_rawLikelihoodValues.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_rawLikelihoodValues.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_rawLikelihoodValues.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_rawLikelihoodValues.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_rawLikelihoodValues = u_st_rawLikelihoodValues.real; + offset += sizeof(this->st_rawLikelihoodValues); + memcpy( &(this->rawLikelihoodValues[i]), &(this->st_rawLikelihoodValues), sizeof(float)); + } + uint32_t weightsKeys_lengthT = ((uint32_t) (*(inbuffer + offset))); + weightsKeys_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + weightsKeys_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + weightsKeys_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->weightsKeys_length); + if(weightsKeys_lengthT > weightsKeys_length) + this->weightsKeys = (int32_t*)realloc(this->weightsKeys, weightsKeys_lengthT * sizeof(int32_t)); + weightsKeys_length = weightsKeys_lengthT; + for( uint32_t i = 0; i < weightsKeys_length; i++){ + union { + int32_t real; + uint32_t base; + } u_st_weightsKeys; + u_st_weightsKeys.base = 0; + u_st_weightsKeys.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_weightsKeys.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_weightsKeys.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_weightsKeys.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_weightsKeys = u_st_weightsKeys.real; + offset += sizeof(this->st_weightsKeys); + memcpy( &(this->weightsKeys[i]), &(this->st_weightsKeys), sizeof(int32_t)); + } + uint32_t weightsValues_lengthT = ((uint32_t) (*(inbuffer + offset))); + weightsValues_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + weightsValues_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + weightsValues_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->weightsValues_length); + if(weightsValues_lengthT > weightsValues_length) + this->weightsValues = (int32_t*)realloc(this->weightsValues, weightsValues_lengthT * sizeof(int32_t)); + weightsValues_length = weightsValues_lengthT; + for( uint32_t i = 0; i < weightsValues_length; i++){ + union { + int32_t real; + uint32_t base; + } u_st_weightsValues; + u_st_weightsValues.base = 0; + u_st_weightsValues.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_weightsValues.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_weightsValues.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_weightsValues.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_weightsValues = u_st_weightsValues.real; + offset += sizeof(this->st_weightsValues); + memcpy( &(this->weightsValues[i]), &(this->st_weightsValues), sizeof(int32_t)); + } + uint32_t labelsKeys_lengthT = ((uint32_t) (*(inbuffer + offset))); + labelsKeys_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + labelsKeys_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + labelsKeys_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->labelsKeys_length); + if(labelsKeys_lengthT > labelsKeys_length) + this->labelsKeys = (int32_t*)realloc(this->labelsKeys, labelsKeys_lengthT * sizeof(int32_t)); + labelsKeys_length = labelsKeys_lengthT; + for( uint32_t i = 0; i < labelsKeys_length; i++){ + union { + int32_t real; + uint32_t base; + } u_st_labelsKeys; + u_st_labelsKeys.base = 0; + u_st_labelsKeys.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_labelsKeys.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_labelsKeys.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_labelsKeys.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_labelsKeys = u_st_labelsKeys.real; + offset += sizeof(this->st_labelsKeys); + memcpy( &(this->labelsKeys[i]), &(this->st_labelsKeys), sizeof(int32_t)); + } + uint32_t labelsValues_lengthT = ((uint32_t) (*(inbuffer + offset))); + labelsValues_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + labelsValues_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + labelsValues_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->labelsValues_length); + if(labelsValues_lengthT > labelsValues_length) + this->labelsValues = (char**)realloc(this->labelsValues, labelsValues_lengthT * sizeof(char*)); + labelsValues_length = labelsValues_lengthT; + for( uint32_t i = 0; i < labelsValues_length; i++){ + uint32_t length_st_labelsValues; + arrToVar(length_st_labelsValues, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_labelsValues; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_labelsValues-1]=0; + this->st_labelsValues = (char *)(inbuffer + offset-1); + offset += length_st_labelsValues; + memcpy( &(this->labelsValues[i]), &(this->st_labelsValues), sizeof(char*)); + } + uint32_t statsKeys_lengthT = ((uint32_t) (*(inbuffer + offset))); + statsKeys_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + statsKeys_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + statsKeys_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->statsKeys_length); + if(statsKeys_lengthT > statsKeys_length) + this->statsKeys = (char**)realloc(this->statsKeys, statsKeys_lengthT * sizeof(char*)); + statsKeys_length = statsKeys_lengthT; + for( uint32_t i = 0; i < statsKeys_length; i++){ + uint32_t length_st_statsKeys; + arrToVar(length_st_statsKeys, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_statsKeys; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_statsKeys-1]=0; + this->st_statsKeys = (char *)(inbuffer + offset-1); + offset += length_st_statsKeys; + memcpy( &(this->statsKeys[i]), &(this->st_statsKeys), sizeof(char*)); + } + uint32_t statsValues_lengthT = ((uint32_t) (*(inbuffer + offset))); + statsValues_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + statsValues_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + statsValues_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->statsValues_length); + if(statsValues_lengthT > statsValues_length) + this->statsValues = (float*)realloc(this->statsValues, statsValues_lengthT * sizeof(float)); + statsValues_length = statsValues_lengthT; + for( uint32_t i = 0; i < statsValues_length; i++){ + union { + float real; + uint32_t base; + } u_st_statsValues; + u_st_statsValues.base = 0; + u_st_statsValues.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_statsValues.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_statsValues.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_statsValues.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_statsValues = u_st_statsValues.real; + offset += sizeof(this->st_statsValues); + memcpy( &(this->statsValues[i]), &(this->st_statsValues), sizeof(float)); + } + uint32_t localPath_lengthT = ((uint32_t) (*(inbuffer + offset))); + localPath_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + localPath_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + localPath_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->localPath_length); + if(localPath_lengthT > localPath_length) + this->localPath = (int32_t*)realloc(this->localPath, localPath_lengthT * sizeof(int32_t)); + localPath_length = localPath_lengthT; + for( uint32_t i = 0; i < localPath_length; i++){ + union { + int32_t real; + uint32_t base; + } u_st_localPath; + u_st_localPath.base = 0; + u_st_localPath.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_localPath.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_localPath.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_localPath.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_localPath = u_st_localPath.real; + offset += sizeof(this->st_localPath); + memcpy( &(this->localPath[i]), &(this->st_localPath), sizeof(int32_t)); + } + union { + int32_t real; + uint32_t base; + } u_currentGoalId; + u_currentGoalId.base = 0; + u_currentGoalId.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_currentGoalId.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_currentGoalId.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_currentGoalId.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->currentGoalId = u_currentGoalId.real; + offset += sizeof(this->currentGoalId); + offset += this->odom_cache.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "rtabmap_msgs/Info"; }; + virtual const char * getMD5() override { return "656fb5b8dfd8dfd2dc40226f35f2d440"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/rtabmap_msgs/KeyPoint.h b/pio_workspace/lib/ros_lib/rtabmap_msgs/KeyPoint.h new file mode 100644 index 0000000..dccef51 --- /dev/null +++ b/pio_workspace/lib/ros_lib/rtabmap_msgs/KeyPoint.h @@ -0,0 +1,164 @@ +#ifndef _ROS_rtabmap_msgs_KeyPoint_h +#define _ROS_rtabmap_msgs_KeyPoint_h + +#include +#include +#include +#include "ros/msg.h" +#include "rtabmap_msgs/Point2f.h" + +namespace rtabmap_msgs +{ + + class KeyPoint : public ros::Msg + { + public: + typedef rtabmap_msgs::Point2f _pt_type; + _pt_type pt; + typedef float _size_type; + _size_type size; + typedef float _angle_type; + _angle_type angle; + typedef float _response_type; + _response_type response; + typedef int32_t _octave_type; + _octave_type octave; + typedef int32_t _class_id_type; + _class_id_type class_id; + + KeyPoint(): + pt(), + size(0), + angle(0), + response(0), + octave(0), + class_id(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->pt.serialize(outbuffer + offset); + union { + float real; + uint32_t base; + } u_size; + u_size.real = this->size; + *(outbuffer + offset + 0) = (u_size.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_size.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_size.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_size.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->size); + union { + float real; + uint32_t base; + } u_angle; + u_angle.real = this->angle; + *(outbuffer + offset + 0) = (u_angle.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_angle.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_angle.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_angle.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->angle); + union { + float real; + uint32_t base; + } u_response; + u_response.real = this->response; + *(outbuffer + offset + 0) = (u_response.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_response.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_response.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_response.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->response); + union { + int32_t real; + uint32_t base; + } u_octave; + u_octave.real = this->octave; + *(outbuffer + offset + 0) = (u_octave.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_octave.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_octave.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_octave.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->octave); + union { + int32_t real; + uint32_t base; + } u_class_id; + u_class_id.real = this->class_id; + *(outbuffer + offset + 0) = (u_class_id.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_class_id.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_class_id.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_class_id.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->class_id); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->pt.deserialize(inbuffer + offset); + union { + float real; + uint32_t base; + } u_size; + u_size.base = 0; + u_size.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_size.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_size.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_size.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->size = u_size.real; + offset += sizeof(this->size); + union { + float real; + uint32_t base; + } u_angle; + u_angle.base = 0; + u_angle.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_angle.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_angle.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_angle.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->angle = u_angle.real; + offset += sizeof(this->angle); + union { + float real; + uint32_t base; + } u_response; + u_response.base = 0; + u_response.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_response.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_response.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_response.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->response = u_response.real; + offset += sizeof(this->response); + union { + int32_t real; + uint32_t base; + } u_octave; + u_octave.base = 0; + u_octave.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_octave.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_octave.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_octave.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->octave = u_octave.real; + offset += sizeof(this->octave); + union { + int32_t real; + uint32_t base; + } u_class_id; + u_class_id.base = 0; + u_class_id.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_class_id.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_class_id.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_class_id.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->class_id = u_class_id.real; + offset += sizeof(this->class_id); + return offset; + } + + virtual const char * getType() override { return "rtabmap_msgs/KeyPoint"; }; + virtual const char * getMD5() override { return "11cefb08bec6034bef3e32ec473dc6a7"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/rtabmap_msgs/LandmarkDetection.h b/pio_workspace/lib/ros_lib/rtabmap_msgs/LandmarkDetection.h new file mode 100644 index 0000000..335c142 --- /dev/null +++ b/pio_workspace/lib/ros_lib/rtabmap_msgs/LandmarkDetection.h @@ -0,0 +1,115 @@ +#ifndef _ROS_rtabmap_msgs_LandmarkDetection_h +#define _ROS_rtabmap_msgs_LandmarkDetection_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/PoseWithCovariance.h" + +namespace rtabmap_msgs +{ + + class LandmarkDetection : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef const char* _landmark_frame_id_type; + _landmark_frame_id_type landmark_frame_id; + typedef int32_t _id_type; + _id_type id; + typedef float _size_type; + _size_type size; + typedef geometry_msgs::PoseWithCovariance _pose_type; + _pose_type pose; + + LandmarkDetection(): + header(), + landmark_frame_id(""), + id(0), + size(0), + pose() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_landmark_frame_id = strlen(this->landmark_frame_id); + varToArr(outbuffer + offset, length_landmark_frame_id); + offset += 4; + memcpy(outbuffer + offset, this->landmark_frame_id, length_landmark_frame_id); + offset += length_landmark_frame_id; + union { + int32_t real; + uint32_t base; + } u_id; + u_id.real = this->id; + *(outbuffer + offset + 0) = (u_id.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_id.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_id.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_id.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->id); + union { + float real; + uint32_t base; + } u_size; + u_size.real = this->size; + *(outbuffer + offset + 0) = (u_size.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_size.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_size.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_size.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->size); + offset += this->pose.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_landmark_frame_id; + arrToVar(length_landmark_frame_id, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_landmark_frame_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_landmark_frame_id-1]=0; + this->landmark_frame_id = (char *)(inbuffer + offset-1); + offset += length_landmark_frame_id; + union { + int32_t real; + uint32_t base; + } u_id; + u_id.base = 0; + u_id.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_id.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_id.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_id.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->id = u_id.real; + offset += sizeof(this->id); + union { + float real; + uint32_t base; + } u_size; + u_size.base = 0; + u_size.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_size.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_size.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_size.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->size = u_size.real; + offset += sizeof(this->size); + offset += this->pose.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "rtabmap_msgs/LandmarkDetection"; }; + virtual const char * getMD5() override { return "4e910c904de3409be6c1521a98c85c31"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/rtabmap_msgs/LandmarkDetections.h b/pio_workspace/lib/ros_lib/rtabmap_msgs/LandmarkDetections.h new file mode 100644 index 0000000..8ada808 --- /dev/null +++ b/pio_workspace/lib/ros_lib/rtabmap_msgs/LandmarkDetections.h @@ -0,0 +1,70 @@ +#ifndef _ROS_rtabmap_msgs_LandmarkDetections_h +#define _ROS_rtabmap_msgs_LandmarkDetections_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "rtabmap_msgs/LandmarkDetection.h" + +namespace rtabmap_msgs +{ + + class LandmarkDetections : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t landmarks_length; + typedef rtabmap_msgs::LandmarkDetection _landmarks_type; + _landmarks_type st_landmarks; + _landmarks_type * landmarks; + + LandmarkDetections(): + header(), + landmarks_length(0), st_landmarks(), landmarks(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->landmarks_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->landmarks_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->landmarks_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->landmarks_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->landmarks_length); + for( uint32_t i = 0; i < landmarks_length; i++){ + offset += this->landmarks[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t landmarks_lengthT = ((uint32_t) (*(inbuffer + offset))); + landmarks_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + landmarks_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + landmarks_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->landmarks_length); + if(landmarks_lengthT > landmarks_length) + this->landmarks = (rtabmap_msgs::LandmarkDetection*)realloc(this->landmarks, landmarks_lengthT * sizeof(rtabmap_msgs::LandmarkDetection)); + landmarks_length = landmarks_lengthT; + for( uint32_t i = 0; i < landmarks_length; i++){ + offset += this->st_landmarks.deserialize(inbuffer + offset); + memcpy( &(this->landmarks[i]), &(this->st_landmarks), sizeof(rtabmap_msgs::LandmarkDetection)); + } + return offset; + } + + virtual const char * getType() override { return "rtabmap_msgs/LandmarkDetections"; }; + virtual const char * getMD5() override { return "6dd251c7971c681b62f6a4fbf33ff4ab"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/rtabmap_msgs/Link.h b/pio_workspace/lib/ros_lib/rtabmap_msgs/Link.h new file mode 100644 index 0000000..006abf9 --- /dev/null +++ b/pio_workspace/lib/ros_lib/rtabmap_msgs/Link.h @@ -0,0 +1,124 @@ +#ifndef _ROS_rtabmap_msgs_Link_h +#define _ROS_rtabmap_msgs_Link_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Transform.h" + +namespace rtabmap_msgs +{ + + class Link : public ros::Msg + { + public: + typedef int32_t _fromId_type; + _fromId_type fromId; + typedef int32_t _toId_type; + _toId_type toId; + typedef int32_t _type_type; + _type_type type; + typedef geometry_msgs::Transform _transform_type; + _transform_type transform; + float information[36]; + + Link(): + fromId(0), + toId(0), + type(0), + transform(), + information() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_fromId; + u_fromId.real = this->fromId; + *(outbuffer + offset + 0) = (u_fromId.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_fromId.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_fromId.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_fromId.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->fromId); + union { + int32_t real; + uint32_t base; + } u_toId; + u_toId.real = this->toId; + *(outbuffer + offset + 0) = (u_toId.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_toId.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_toId.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_toId.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->toId); + union { + int32_t real; + uint32_t base; + } u_type; + u_type.real = this->type; + *(outbuffer + offset + 0) = (u_type.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_type.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_type.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_type.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->type); + offset += this->transform.serialize(outbuffer + offset); + for( uint32_t i = 0; i < 36; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->information[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_fromId; + u_fromId.base = 0; + u_fromId.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_fromId.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_fromId.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_fromId.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->fromId = u_fromId.real; + offset += sizeof(this->fromId); + union { + int32_t real; + uint32_t base; + } u_toId; + u_toId.base = 0; + u_toId.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_toId.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_toId.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_toId.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->toId = u_toId.real; + offset += sizeof(this->toId); + union { + int32_t real; + uint32_t base; + } u_type; + u_type.base = 0; + u_type.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_type.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_type.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_type.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->type = u_type.real; + offset += sizeof(this->type); + offset += this->transform.deserialize(inbuffer + offset); + for( uint32_t i = 0; i < 36; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->information[i])); + } + return offset; + } + + virtual const char * getType() override { return "rtabmap_msgs/Link"; }; + virtual const char * getMD5() override { return "48bafa7643c4731e90b468e7c4fa06b6"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/rtabmap_msgs/ListLabels.h b/pio_workspace/lib/ros_lib/rtabmap_msgs/ListLabels.h new file mode 100644 index 0000000..4a010ae --- /dev/null +++ b/pio_workspace/lib/ros_lib/rtabmap_msgs/ListLabels.h @@ -0,0 +1,151 @@ +#ifndef _ROS_SERVICE_ListLabels_h +#define _ROS_SERVICE_ListLabels_h +#include +#include +#include +#include "ros/msg.h" + +namespace rtabmap_msgs +{ + +static const char LISTLABELS[] = "rtabmap_msgs/ListLabels"; + + class ListLabelsRequest : public ros::Msg + { + public: + + ListLabelsRequest() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + return offset; + } + + virtual const char * getType() override { return LISTLABELS; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class ListLabelsResponse : public ros::Msg + { + public: + uint32_t ids_length; + typedef int32_t _ids_type; + _ids_type st_ids; + _ids_type * ids; + uint32_t labels_length; + typedef char* _labels_type; + _labels_type st_labels; + _labels_type * labels; + + ListLabelsResponse(): + ids_length(0), st_ids(), ids(nullptr), + labels_length(0), st_labels(), labels(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->ids_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->ids_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->ids_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->ids_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->ids_length); + for( uint32_t i = 0; i < ids_length; i++){ + union { + int32_t real; + uint32_t base; + } u_idsi; + u_idsi.real = this->ids[i]; + *(outbuffer + offset + 0) = (u_idsi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_idsi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_idsi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_idsi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->ids[i]); + } + *(outbuffer + offset + 0) = (this->labels_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->labels_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->labels_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->labels_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->labels_length); + for( uint32_t i = 0; i < labels_length; i++){ + uint32_t length_labelsi = strlen(this->labels[i]); + varToArr(outbuffer + offset, length_labelsi); + offset += 4; + memcpy(outbuffer + offset, this->labels[i], length_labelsi); + offset += length_labelsi; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t ids_lengthT = ((uint32_t) (*(inbuffer + offset))); + ids_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + ids_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + ids_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->ids_length); + if(ids_lengthT > ids_length) + this->ids = (int32_t*)realloc(this->ids, ids_lengthT * sizeof(int32_t)); + ids_length = ids_lengthT; + for( uint32_t i = 0; i < ids_length; i++){ + union { + int32_t real; + uint32_t base; + } u_st_ids; + u_st_ids.base = 0; + u_st_ids.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_ids.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_ids.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_ids.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_ids = u_st_ids.real; + offset += sizeof(this->st_ids); + memcpy( &(this->ids[i]), &(this->st_ids), sizeof(int32_t)); + } + uint32_t labels_lengthT = ((uint32_t) (*(inbuffer + offset))); + labels_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + labels_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + labels_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->labels_length); + if(labels_lengthT > labels_length) + this->labels = (char**)realloc(this->labels, labels_lengthT * sizeof(char*)); + labels_length = labels_lengthT; + for( uint32_t i = 0; i < labels_length; i++){ + uint32_t length_st_labels; + arrToVar(length_st_labels, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_labels; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_labels-1]=0; + this->st_labels = (char *)(inbuffer + offset-1); + offset += length_st_labels; + memcpy( &(this->labels[i]), &(this->st_labels), sizeof(char*)); + } + return offset; + } + + virtual const char * getType() override { return LISTLABELS; }; + virtual const char * getMD5() override { return "eeaf81b9c58c5f0e5150e4704df1159c"; }; + + }; + + class ListLabels { + public: + typedef ListLabelsRequest Request; + typedef ListLabelsResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/rtabmap_msgs/LoadDatabase.h b/pio_workspace/lib/ros_lib/rtabmap_msgs/LoadDatabase.h new file mode 100644 index 0000000..39884c4 --- /dev/null +++ b/pio_workspace/lib/ros_lib/rtabmap_msgs/LoadDatabase.h @@ -0,0 +1,105 @@ +#ifndef _ROS_SERVICE_LoadDatabase_h +#define _ROS_SERVICE_LoadDatabase_h +#include +#include +#include +#include "ros/msg.h" + +namespace rtabmap_msgs +{ + +static const char LOADDATABASE[] = "rtabmap_msgs/LoadDatabase"; + + class LoadDatabaseRequest : public ros::Msg + { + public: + typedef const char* _database_path_type; + _database_path_type database_path; + typedef bool _clear_type; + _clear_type clear; + + LoadDatabaseRequest(): + database_path(""), + clear(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_database_path = strlen(this->database_path); + varToArr(outbuffer + offset, length_database_path); + offset += 4; + memcpy(outbuffer + offset, this->database_path, length_database_path); + offset += length_database_path; + union { + bool real; + uint8_t base; + } u_clear; + u_clear.real = this->clear; + *(outbuffer + offset + 0) = (u_clear.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->clear); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_database_path; + arrToVar(length_database_path, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_database_path; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_database_path-1]=0; + this->database_path = (char *)(inbuffer + offset-1); + offset += length_database_path; + union { + bool real; + uint8_t base; + } u_clear; + u_clear.base = 0; + u_clear.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->clear = u_clear.real; + offset += sizeof(this->clear); + return offset; + } + + virtual const char * getType() override { return LOADDATABASE; }; + virtual const char * getMD5() override { return "686abf12c0ee22118c7e5fcc29bcdabe"; }; + + }; + + class LoadDatabaseResponse : public ros::Msg + { + public: + + LoadDatabaseResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + return offset; + } + + virtual const char * getType() override { return LOADDATABASE; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class LoadDatabase { + public: + typedef LoadDatabaseRequest Request; + typedef LoadDatabaseResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/rtabmap_msgs/MapData.h b/pio_workspace/lib/ros_lib/rtabmap_msgs/MapData.h new file mode 100644 index 0000000..564149a --- /dev/null +++ b/pio_workspace/lib/ros_lib/rtabmap_msgs/MapData.h @@ -0,0 +1,76 @@ +#ifndef _ROS_rtabmap_msgs_MapData_h +#define _ROS_rtabmap_msgs_MapData_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "rtabmap_msgs/MapGraph.h" +#include "rtabmap_msgs/Node.h" + +namespace rtabmap_msgs +{ + + class MapData : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef rtabmap_msgs::MapGraph _graph_type; + _graph_type graph; + uint32_t nodes_length; + typedef rtabmap_msgs::Node _nodes_type; + _nodes_type st_nodes; + _nodes_type * nodes; + + MapData(): + header(), + graph(), + nodes_length(0), st_nodes(), nodes(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->graph.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->nodes_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->nodes_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->nodes_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->nodes_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->nodes_length); + for( uint32_t i = 0; i < nodes_length; i++){ + offset += this->nodes[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->graph.deserialize(inbuffer + offset); + uint32_t nodes_lengthT = ((uint32_t) (*(inbuffer + offset))); + nodes_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + nodes_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + nodes_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->nodes_length); + if(nodes_lengthT > nodes_length) + this->nodes = (rtabmap_msgs::Node*)realloc(this->nodes, nodes_lengthT * sizeof(rtabmap_msgs::Node)); + nodes_length = nodes_lengthT; + for( uint32_t i = 0; i < nodes_length; i++){ + offset += this->st_nodes.deserialize(inbuffer + offset); + memcpy( &(this->nodes[i]), &(this->st_nodes), sizeof(rtabmap_msgs::Node)); + } + return offset; + } + + virtual const char * getType() override { return "rtabmap_msgs/MapData"; }; + virtual const char * getMD5() override { return "8a55e0977a9f84c59a3a4a704094fef1"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/rtabmap_msgs/MapGraph.h b/pio_workspace/lib/ros_lib/rtabmap_msgs/MapGraph.h new file mode 100644 index 0000000..fbaeac3 --- /dev/null +++ b/pio_workspace/lib/ros_lib/rtabmap_msgs/MapGraph.h @@ -0,0 +1,146 @@ +#ifndef _ROS_rtabmap_msgs_MapGraph_h +#define _ROS_rtabmap_msgs_MapGraph_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Transform.h" +#include "geometry_msgs/Pose.h" +#include "rtabmap_msgs/Link.h" + +namespace rtabmap_msgs +{ + + class MapGraph : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef geometry_msgs::Transform _mapToOdom_type; + _mapToOdom_type mapToOdom; + uint32_t posesId_length; + typedef int32_t _posesId_type; + _posesId_type st_posesId; + _posesId_type * posesId; + uint32_t poses_length; + typedef geometry_msgs::Pose _poses_type; + _poses_type st_poses; + _poses_type * poses; + uint32_t links_length; + typedef rtabmap_msgs::Link _links_type; + _links_type st_links; + _links_type * links; + + MapGraph(): + header(), + mapToOdom(), + posesId_length(0), st_posesId(), posesId(nullptr), + poses_length(0), st_poses(), poses(nullptr), + links_length(0), st_links(), links(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->mapToOdom.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->posesId_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->posesId_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->posesId_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->posesId_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->posesId_length); + for( uint32_t i = 0; i < posesId_length; i++){ + union { + int32_t real; + uint32_t base; + } u_posesIdi; + u_posesIdi.real = this->posesId[i]; + *(outbuffer + offset + 0) = (u_posesIdi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_posesIdi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_posesIdi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_posesIdi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->posesId[i]); + } + *(outbuffer + offset + 0) = (this->poses_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->poses_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->poses_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->poses_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->poses_length); + for( uint32_t i = 0; i < poses_length; i++){ + offset += this->poses[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->links_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->links_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->links_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->links_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->links_length); + for( uint32_t i = 0; i < links_length; i++){ + offset += this->links[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->mapToOdom.deserialize(inbuffer + offset); + uint32_t posesId_lengthT = ((uint32_t) (*(inbuffer + offset))); + posesId_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + posesId_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + posesId_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->posesId_length); + if(posesId_lengthT > posesId_length) + this->posesId = (int32_t*)realloc(this->posesId, posesId_lengthT * sizeof(int32_t)); + posesId_length = posesId_lengthT; + for( uint32_t i = 0; i < posesId_length; i++){ + union { + int32_t real; + uint32_t base; + } u_st_posesId; + u_st_posesId.base = 0; + u_st_posesId.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_posesId.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_posesId.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_posesId.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_posesId = u_st_posesId.real; + offset += sizeof(this->st_posesId); + memcpy( &(this->posesId[i]), &(this->st_posesId), sizeof(int32_t)); + } + uint32_t poses_lengthT = ((uint32_t) (*(inbuffer + offset))); + poses_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + poses_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + poses_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->poses_length); + if(poses_lengthT > poses_length) + this->poses = (geometry_msgs::Pose*)realloc(this->poses, poses_lengthT * sizeof(geometry_msgs::Pose)); + poses_length = poses_lengthT; + for( uint32_t i = 0; i < poses_length; i++){ + offset += this->st_poses.deserialize(inbuffer + offset); + memcpy( &(this->poses[i]), &(this->st_poses), sizeof(geometry_msgs::Pose)); + } + uint32_t links_lengthT = ((uint32_t) (*(inbuffer + offset))); + links_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + links_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + links_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->links_length); + if(links_lengthT > links_length) + this->links = (rtabmap_msgs::Link*)realloc(this->links, links_lengthT * sizeof(rtabmap_msgs::Link)); + links_length = links_lengthT; + for( uint32_t i = 0; i < links_length; i++){ + offset += this->st_links.deserialize(inbuffer + offset); + memcpy( &(this->links[i]), &(this->st_links), sizeof(rtabmap_msgs::Link)); + } + return offset; + } + + virtual const char * getType() override { return "rtabmap_msgs/MapGraph"; }; + virtual const char * getMD5() override { return "903c2e44ed7e275e08ef323188cb38ee"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/rtabmap_msgs/Node.h b/pio_workspace/lib/ros_lib/rtabmap_msgs/Node.h new file mode 100644 index 0000000..9891b74 --- /dev/null +++ b/pio_workspace/lib/ros_lib/rtabmap_msgs/Node.h @@ -0,0 +1,311 @@ +#ifndef _ROS_rtabmap_msgs_Node_h +#define _ROS_rtabmap_msgs_Node_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Pose.h" +#include "rtabmap_msgs/KeyPoint.h" +#include "rtabmap_msgs/Point3f.h" +#include "rtabmap_msgs/SensorData.h" + +namespace rtabmap_msgs +{ + + class Node : public ros::Msg + { + public: + typedef int32_t _id_type; + _id_type id; + typedef int32_t _map_id_type; + _map_id_type map_id; + typedef int32_t _weight_type; + _weight_type weight; + typedef float _stamp_type; + _stamp_type stamp; + typedef const char* _label_type; + _label_type label; + typedef geometry_msgs::Pose _pose_type; + _pose_type pose; + uint32_t word_id_keys_length; + typedef int32_t _word_id_keys_type; + _word_id_keys_type st_word_id_keys; + _word_id_keys_type * word_id_keys; + uint32_t word_id_values_length; + typedef int32_t _word_id_values_type; + _word_id_values_type st_word_id_values; + _word_id_values_type * word_id_values; + uint32_t word_kpts_length; + typedef rtabmap_msgs::KeyPoint _word_kpts_type; + _word_kpts_type st_word_kpts; + _word_kpts_type * word_kpts; + uint32_t word_pts_length; + typedef rtabmap_msgs::Point3f _word_pts_type; + _word_pts_type st_word_pts; + _word_pts_type * word_pts; + uint32_t word_descriptors_length; + typedef uint8_t _word_descriptors_type; + _word_descriptors_type st_word_descriptors; + _word_descriptors_type * word_descriptors; + typedef rtabmap_msgs::SensorData _data_type; + _data_type data; + + Node(): + id(0), + map_id(0), + weight(0), + stamp(0), + label(""), + pose(), + word_id_keys_length(0), st_word_id_keys(), word_id_keys(nullptr), + word_id_values_length(0), st_word_id_values(), word_id_values(nullptr), + word_kpts_length(0), st_word_kpts(), word_kpts(nullptr), + word_pts_length(0), st_word_pts(), word_pts(nullptr), + word_descriptors_length(0), st_word_descriptors(), word_descriptors(nullptr), + data() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_id; + u_id.real = this->id; + *(outbuffer + offset + 0) = (u_id.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_id.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_id.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_id.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->id); + union { + int32_t real; + uint32_t base; + } u_map_id; + u_map_id.real = this->map_id; + *(outbuffer + offset + 0) = (u_map_id.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_map_id.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_map_id.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_map_id.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->map_id); + union { + int32_t real; + uint32_t base; + } u_weight; + u_weight.real = this->weight; + *(outbuffer + offset + 0) = (u_weight.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_weight.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_weight.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_weight.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->weight); + offset += serializeAvrFloat64(outbuffer + offset, this->stamp); + uint32_t length_label = strlen(this->label); + varToArr(outbuffer + offset, length_label); + offset += 4; + memcpy(outbuffer + offset, this->label, length_label); + offset += length_label; + offset += this->pose.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->word_id_keys_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->word_id_keys_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->word_id_keys_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->word_id_keys_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->word_id_keys_length); + for( uint32_t i = 0; i < word_id_keys_length; i++){ + union { + int32_t real; + uint32_t base; + } u_word_id_keysi; + u_word_id_keysi.real = this->word_id_keys[i]; + *(outbuffer + offset + 0) = (u_word_id_keysi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_word_id_keysi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_word_id_keysi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_word_id_keysi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->word_id_keys[i]); + } + *(outbuffer + offset + 0) = (this->word_id_values_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->word_id_values_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->word_id_values_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->word_id_values_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->word_id_values_length); + for( uint32_t i = 0; i < word_id_values_length; i++){ + union { + int32_t real; + uint32_t base; + } u_word_id_valuesi; + u_word_id_valuesi.real = this->word_id_values[i]; + *(outbuffer + offset + 0) = (u_word_id_valuesi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_word_id_valuesi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_word_id_valuesi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_word_id_valuesi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->word_id_values[i]); + } + *(outbuffer + offset + 0) = (this->word_kpts_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->word_kpts_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->word_kpts_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->word_kpts_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->word_kpts_length); + for( uint32_t i = 0; i < word_kpts_length; i++){ + offset += this->word_kpts[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->word_pts_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->word_pts_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->word_pts_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->word_pts_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->word_pts_length); + for( uint32_t i = 0; i < word_pts_length; i++){ + offset += this->word_pts[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->word_descriptors_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->word_descriptors_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->word_descriptors_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->word_descriptors_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->word_descriptors_length); + for( uint32_t i = 0; i < word_descriptors_length; i++){ + *(outbuffer + offset + 0) = (this->word_descriptors[i] >> (8 * 0)) & 0xFF; + offset += sizeof(this->word_descriptors[i]); + } + offset += this->data.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_id; + u_id.base = 0; + u_id.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_id.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_id.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_id.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->id = u_id.real; + offset += sizeof(this->id); + union { + int32_t real; + uint32_t base; + } u_map_id; + u_map_id.base = 0; + u_map_id.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_map_id.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_map_id.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_map_id.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->map_id = u_map_id.real; + offset += sizeof(this->map_id); + union { + int32_t real; + uint32_t base; + } u_weight; + u_weight.base = 0; + u_weight.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_weight.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_weight.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_weight.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->weight = u_weight.real; + offset += sizeof(this->weight); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->stamp)); + uint32_t length_label; + arrToVar(length_label, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_label; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_label-1]=0; + this->label = (char *)(inbuffer + offset-1); + offset += length_label; + offset += this->pose.deserialize(inbuffer + offset); + uint32_t word_id_keys_lengthT = ((uint32_t) (*(inbuffer + offset))); + word_id_keys_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + word_id_keys_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + word_id_keys_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->word_id_keys_length); + if(word_id_keys_lengthT > word_id_keys_length) + this->word_id_keys = (int32_t*)realloc(this->word_id_keys, word_id_keys_lengthT * sizeof(int32_t)); + word_id_keys_length = word_id_keys_lengthT; + for( uint32_t i = 0; i < word_id_keys_length; i++){ + union { + int32_t real; + uint32_t base; + } u_st_word_id_keys; + u_st_word_id_keys.base = 0; + u_st_word_id_keys.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_word_id_keys.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_word_id_keys.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_word_id_keys.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_word_id_keys = u_st_word_id_keys.real; + offset += sizeof(this->st_word_id_keys); + memcpy( &(this->word_id_keys[i]), &(this->st_word_id_keys), sizeof(int32_t)); + } + uint32_t word_id_values_lengthT = ((uint32_t) (*(inbuffer + offset))); + word_id_values_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + word_id_values_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + word_id_values_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->word_id_values_length); + if(word_id_values_lengthT > word_id_values_length) + this->word_id_values = (int32_t*)realloc(this->word_id_values, word_id_values_lengthT * sizeof(int32_t)); + word_id_values_length = word_id_values_lengthT; + for( uint32_t i = 0; i < word_id_values_length; i++){ + union { + int32_t real; + uint32_t base; + } u_st_word_id_values; + u_st_word_id_values.base = 0; + u_st_word_id_values.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_word_id_values.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_word_id_values.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_word_id_values.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_word_id_values = u_st_word_id_values.real; + offset += sizeof(this->st_word_id_values); + memcpy( &(this->word_id_values[i]), &(this->st_word_id_values), sizeof(int32_t)); + } + uint32_t word_kpts_lengthT = ((uint32_t) (*(inbuffer + offset))); + word_kpts_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + word_kpts_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + word_kpts_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->word_kpts_length); + if(word_kpts_lengthT > word_kpts_length) + this->word_kpts = (rtabmap_msgs::KeyPoint*)realloc(this->word_kpts, word_kpts_lengthT * sizeof(rtabmap_msgs::KeyPoint)); + word_kpts_length = word_kpts_lengthT; + for( uint32_t i = 0; i < word_kpts_length; i++){ + offset += this->st_word_kpts.deserialize(inbuffer + offset); + memcpy( &(this->word_kpts[i]), &(this->st_word_kpts), sizeof(rtabmap_msgs::KeyPoint)); + } + uint32_t word_pts_lengthT = ((uint32_t) (*(inbuffer + offset))); + word_pts_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + word_pts_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + word_pts_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->word_pts_length); + if(word_pts_lengthT > word_pts_length) + this->word_pts = (rtabmap_msgs::Point3f*)realloc(this->word_pts, word_pts_lengthT * sizeof(rtabmap_msgs::Point3f)); + word_pts_length = word_pts_lengthT; + for( uint32_t i = 0; i < word_pts_length; i++){ + offset += this->st_word_pts.deserialize(inbuffer + offset); + memcpy( &(this->word_pts[i]), &(this->st_word_pts), sizeof(rtabmap_msgs::Point3f)); + } + uint32_t word_descriptors_lengthT = ((uint32_t) (*(inbuffer + offset))); + word_descriptors_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + word_descriptors_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + word_descriptors_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->word_descriptors_length); + if(word_descriptors_lengthT > word_descriptors_length) + this->word_descriptors = (uint8_t*)realloc(this->word_descriptors, word_descriptors_lengthT * sizeof(uint8_t)); + word_descriptors_length = word_descriptors_lengthT; + for( uint32_t i = 0; i < word_descriptors_length; i++){ + this->st_word_descriptors = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->st_word_descriptors); + memcpy( &(this->word_descriptors[i]), &(this->st_word_descriptors), sizeof(uint8_t)); + } + offset += this->data.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "rtabmap_msgs/Node"; }; + virtual const char * getMD5() override { return "1e8d995f879dedebdf00969128c2dfa0"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/rtabmap_msgs/OdomInfo.h b/pio_workspace/lib/ros_lib/rtabmap_msgs/OdomInfo.h new file mode 100644 index 0000000..8f1f24f --- /dev/null +++ b/pio_workspace/lib/ros_lib/rtabmap_msgs/OdomInfo.h @@ -0,0 +1,1158 @@ +#ifndef _ROS_rtabmap_msgs_OdomInfo_h +#define _ROS_rtabmap_msgs_OdomInfo_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "rtabmap_msgs/CameraModels.h" +#include "geometry_msgs/Pose.h" +#include "geometry_msgs/Transform.h" +#include "rtabmap_msgs/KeyPoint.h" +#include "rtabmap_msgs/Point3f.h" +#include "sensor_msgs/PointCloud2.h" +#include "rtabmap_msgs/Point2f.h" + +namespace rtabmap_msgs +{ + + class OdomInfo : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef bool _lost_type; + _lost_type lost; + typedef int32_t _matches_type; + _matches_type matches; + typedef int32_t _inliers_type; + _inliers_type inliers; + typedef float _icpInliersRatio_type; + _icpInliersRatio_type icpInliersRatio; + typedef float _icpRotation_type; + _icpRotation_type icpRotation; + typedef float _icpTranslation_type; + _icpTranslation_type icpTranslation; + typedef float _icpStructuralComplexity_type; + _icpStructuralComplexity_type icpStructuralComplexity; + typedef float _icpStructuralDistribution_type; + _icpStructuralDistribution_type icpStructuralDistribution; + typedef int32_t _icpCorrespondences_type; + _icpCorrespondences_type icpCorrespondences; + float covariance[36]; + typedef int32_t _features_type; + _features_type features; + typedef int32_t _localMapSize_type; + _localMapSize_type localMapSize; + typedef int32_t _localScanMapSize_type; + _localScanMapSize_type localScanMapSize; + typedef int32_t _localKeyFrames_type; + _localKeyFrames_type localKeyFrames; + typedef int32_t _localBundleOutliers_type; + _localBundleOutliers_type localBundleOutliers; + typedef int32_t _localBundleConstraints_type; + _localBundleConstraints_type localBundleConstraints; + typedef float _localBundleTime_type; + _localBundleTime_type localBundleTime; + typedef float _localBundleAvgInlierDistance_type; + _localBundleAvgInlierDistance_type localBundleAvgInlierDistance; + typedef int32_t _localBundleMaxKeyFramesForInlier_type; + _localBundleMaxKeyFramesForInlier_type localBundleMaxKeyFramesForInlier; + typedef bool _keyFrameAdded_type; + _keyFrameAdded_type keyFrameAdded; + typedef float _timeEstimation_type; + _timeEstimation_type timeEstimation; + typedef float _timeParticleFiltering_type; + _timeParticleFiltering_type timeParticleFiltering; + typedef float _stamp_type; + _stamp_type stamp; + typedef float _interval_type; + _interval_type interval; + typedef float _distanceTravelled_type; + _distanceTravelled_type distanceTravelled; + typedef int32_t _memoryUsage_type; + _memoryUsage_type memoryUsage; + typedef float _gravityRollError_type; + _gravityRollError_type gravityRollError; + typedef float _gravityPitchError_type; + _gravityPitchError_type gravityPitchError; + uint32_t localBundleIds_length; + typedef int32_t _localBundleIds_type; + _localBundleIds_type st_localBundleIds; + _localBundleIds_type * localBundleIds; + uint32_t localBundleModels_length; + typedef rtabmap_msgs::CameraModels _localBundleModels_type; + _localBundleModels_type st_localBundleModels; + _localBundleModels_type * localBundleModels; + uint32_t localBundlePoses_length; + typedef geometry_msgs::Pose _localBundlePoses_type; + _localBundlePoses_type st_localBundlePoses; + _localBundlePoses_type * localBundlePoses; + typedef geometry_msgs::Transform _transform_type; + _transform_type transform; + typedef geometry_msgs::Transform _transformFiltered_type; + _transformFiltered_type transformFiltered; + typedef geometry_msgs::Transform _transformGroundTruth_type; + _transformGroundTruth_type transformGroundTruth; + typedef geometry_msgs::Transform _guess_type; + _guess_type guess; + typedef int32_t _type_type; + _type_type type; + uint32_t wordsKeys_length; + typedef int32_t _wordsKeys_type; + _wordsKeys_type st_wordsKeys; + _wordsKeys_type * wordsKeys; + uint32_t wordsValues_length; + typedef rtabmap_msgs::KeyPoint _wordsValues_type; + _wordsValues_type st_wordsValues; + _wordsValues_type * wordsValues; + uint32_t wordMatches_length; + typedef int32_t _wordMatches_type; + _wordMatches_type st_wordMatches; + _wordMatches_type * wordMatches; + uint32_t wordInliers_length; + typedef int32_t _wordInliers_type; + _wordInliers_type st_wordInliers; + _wordInliers_type * wordInliers; + uint32_t localMapKeys_length; + typedef int32_t _localMapKeys_type; + _localMapKeys_type st_localMapKeys; + _localMapKeys_type * localMapKeys; + uint32_t localMapValues_length; + typedef rtabmap_msgs::Point3f _localMapValues_type; + _localMapValues_type st_localMapValues; + _localMapValues_type * localMapValues; + typedef sensor_msgs::PointCloud2 _localScanMap_type; + _localScanMap_type localScanMap; + uint32_t refCorners_length; + typedef rtabmap_msgs::Point2f _refCorners_type; + _refCorners_type st_refCorners; + _refCorners_type * refCorners; + uint32_t newCorners_length; + typedef rtabmap_msgs::Point2f _newCorners_type; + _newCorners_type st_newCorners; + _newCorners_type * newCorners; + uint32_t cornerInliers_length; + typedef int32_t _cornerInliers_type; + _cornerInliers_type st_cornerInliers; + _cornerInliers_type * cornerInliers; + + OdomInfo(): + header(), + lost(0), + matches(0), + inliers(0), + icpInliersRatio(0), + icpRotation(0), + icpTranslation(0), + icpStructuralComplexity(0), + icpStructuralDistribution(0), + icpCorrespondences(0), + covariance(), + features(0), + localMapSize(0), + localScanMapSize(0), + localKeyFrames(0), + localBundleOutliers(0), + localBundleConstraints(0), + localBundleTime(0), + localBundleAvgInlierDistance(0), + localBundleMaxKeyFramesForInlier(0), + keyFrameAdded(0), + timeEstimation(0), + timeParticleFiltering(0), + stamp(0), + interval(0), + distanceTravelled(0), + memoryUsage(0), + gravityRollError(0), + gravityPitchError(0), + localBundleIds_length(0), st_localBundleIds(), localBundleIds(nullptr), + localBundleModels_length(0), st_localBundleModels(), localBundleModels(nullptr), + localBundlePoses_length(0), st_localBundlePoses(), localBundlePoses(nullptr), + transform(), + transformFiltered(), + transformGroundTruth(), + guess(), + type(0), + wordsKeys_length(0), st_wordsKeys(), wordsKeys(nullptr), + wordsValues_length(0), st_wordsValues(), wordsValues(nullptr), + wordMatches_length(0), st_wordMatches(), wordMatches(nullptr), + wordInliers_length(0), st_wordInliers(), wordInliers(nullptr), + localMapKeys_length(0), st_localMapKeys(), localMapKeys(nullptr), + localMapValues_length(0), st_localMapValues(), localMapValues(nullptr), + localScanMap(), + refCorners_length(0), st_refCorners(), refCorners(nullptr), + newCorners_length(0), st_newCorners(), newCorners(nullptr), + cornerInliers_length(0), st_cornerInliers(), cornerInliers(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + union { + bool real; + uint8_t base; + } u_lost; + u_lost.real = this->lost; + *(outbuffer + offset + 0) = (u_lost.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->lost); + union { + int32_t real; + uint32_t base; + } u_matches; + u_matches.real = this->matches; + *(outbuffer + offset + 0) = (u_matches.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_matches.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_matches.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_matches.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->matches); + union { + int32_t real; + uint32_t base; + } u_inliers; + u_inliers.real = this->inliers; + *(outbuffer + offset + 0) = (u_inliers.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_inliers.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_inliers.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_inliers.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->inliers); + union { + float real; + uint32_t base; + } u_icpInliersRatio; + u_icpInliersRatio.real = this->icpInliersRatio; + *(outbuffer + offset + 0) = (u_icpInliersRatio.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_icpInliersRatio.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_icpInliersRatio.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_icpInliersRatio.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->icpInliersRatio); + union { + float real; + uint32_t base; + } u_icpRotation; + u_icpRotation.real = this->icpRotation; + *(outbuffer + offset + 0) = (u_icpRotation.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_icpRotation.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_icpRotation.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_icpRotation.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->icpRotation); + union { + float real; + uint32_t base; + } u_icpTranslation; + u_icpTranslation.real = this->icpTranslation; + *(outbuffer + offset + 0) = (u_icpTranslation.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_icpTranslation.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_icpTranslation.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_icpTranslation.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->icpTranslation); + union { + float real; + uint32_t base; + } u_icpStructuralComplexity; + u_icpStructuralComplexity.real = this->icpStructuralComplexity; + *(outbuffer + offset + 0) = (u_icpStructuralComplexity.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_icpStructuralComplexity.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_icpStructuralComplexity.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_icpStructuralComplexity.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->icpStructuralComplexity); + union { + float real; + uint32_t base; + } u_icpStructuralDistribution; + u_icpStructuralDistribution.real = this->icpStructuralDistribution; + *(outbuffer + offset + 0) = (u_icpStructuralDistribution.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_icpStructuralDistribution.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_icpStructuralDistribution.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_icpStructuralDistribution.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->icpStructuralDistribution); + union { + int32_t real; + uint32_t base; + } u_icpCorrespondences; + u_icpCorrespondences.real = this->icpCorrespondences; + *(outbuffer + offset + 0) = (u_icpCorrespondences.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_icpCorrespondences.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_icpCorrespondences.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_icpCorrespondences.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->icpCorrespondences); + for( uint32_t i = 0; i < 36; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->covariance[i]); + } + union { + int32_t real; + uint32_t base; + } u_features; + u_features.real = this->features; + *(outbuffer + offset + 0) = (u_features.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_features.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_features.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_features.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->features); + union { + int32_t real; + uint32_t base; + } u_localMapSize; + u_localMapSize.real = this->localMapSize; + *(outbuffer + offset + 0) = (u_localMapSize.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_localMapSize.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_localMapSize.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_localMapSize.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->localMapSize); + union { + int32_t real; + uint32_t base; + } u_localScanMapSize; + u_localScanMapSize.real = this->localScanMapSize; + *(outbuffer + offset + 0) = (u_localScanMapSize.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_localScanMapSize.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_localScanMapSize.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_localScanMapSize.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->localScanMapSize); + union { + int32_t real; + uint32_t base; + } u_localKeyFrames; + u_localKeyFrames.real = this->localKeyFrames; + *(outbuffer + offset + 0) = (u_localKeyFrames.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_localKeyFrames.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_localKeyFrames.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_localKeyFrames.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->localKeyFrames); + union { + int32_t real; + uint32_t base; + } u_localBundleOutliers; + u_localBundleOutliers.real = this->localBundleOutliers; + *(outbuffer + offset + 0) = (u_localBundleOutliers.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_localBundleOutliers.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_localBundleOutliers.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_localBundleOutliers.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->localBundleOutliers); + union { + int32_t real; + uint32_t base; + } u_localBundleConstraints; + u_localBundleConstraints.real = this->localBundleConstraints; + *(outbuffer + offset + 0) = (u_localBundleConstraints.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_localBundleConstraints.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_localBundleConstraints.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_localBundleConstraints.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->localBundleConstraints); + union { + float real; + uint32_t base; + } u_localBundleTime; + u_localBundleTime.real = this->localBundleTime; + *(outbuffer + offset + 0) = (u_localBundleTime.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_localBundleTime.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_localBundleTime.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_localBundleTime.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->localBundleTime); + union { + float real; + uint32_t base; + } u_localBundleAvgInlierDistance; + u_localBundleAvgInlierDistance.real = this->localBundleAvgInlierDistance; + *(outbuffer + offset + 0) = (u_localBundleAvgInlierDistance.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_localBundleAvgInlierDistance.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_localBundleAvgInlierDistance.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_localBundleAvgInlierDistance.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->localBundleAvgInlierDistance); + union { + int32_t real; + uint32_t base; + } u_localBundleMaxKeyFramesForInlier; + u_localBundleMaxKeyFramesForInlier.real = this->localBundleMaxKeyFramesForInlier; + *(outbuffer + offset + 0) = (u_localBundleMaxKeyFramesForInlier.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_localBundleMaxKeyFramesForInlier.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_localBundleMaxKeyFramesForInlier.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_localBundleMaxKeyFramesForInlier.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->localBundleMaxKeyFramesForInlier); + union { + bool real; + uint8_t base; + } u_keyFrameAdded; + u_keyFrameAdded.real = this->keyFrameAdded; + *(outbuffer + offset + 0) = (u_keyFrameAdded.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->keyFrameAdded); + union { + float real; + uint32_t base; + } u_timeEstimation; + u_timeEstimation.real = this->timeEstimation; + *(outbuffer + offset + 0) = (u_timeEstimation.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_timeEstimation.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_timeEstimation.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_timeEstimation.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->timeEstimation); + union { + float real; + uint32_t base; + } u_timeParticleFiltering; + u_timeParticleFiltering.real = this->timeParticleFiltering; + *(outbuffer + offset + 0) = (u_timeParticleFiltering.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_timeParticleFiltering.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_timeParticleFiltering.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_timeParticleFiltering.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->timeParticleFiltering); + union { + float real; + uint32_t base; + } u_stamp; + u_stamp.real = this->stamp; + *(outbuffer + offset + 0) = (u_stamp.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_stamp.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_stamp.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_stamp.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->stamp); + union { + float real; + uint32_t base; + } u_interval; + u_interval.real = this->interval; + *(outbuffer + offset + 0) = (u_interval.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_interval.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_interval.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_interval.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->interval); + union { + float real; + uint32_t base; + } u_distanceTravelled; + u_distanceTravelled.real = this->distanceTravelled; + *(outbuffer + offset + 0) = (u_distanceTravelled.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_distanceTravelled.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_distanceTravelled.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_distanceTravelled.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->distanceTravelled); + union { + int32_t real; + uint32_t base; + } u_memoryUsage; + u_memoryUsage.real = this->memoryUsage; + *(outbuffer + offset + 0) = (u_memoryUsage.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_memoryUsage.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_memoryUsage.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_memoryUsage.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->memoryUsage); + union { + float real; + uint32_t base; + } u_gravityRollError; + u_gravityRollError.real = this->gravityRollError; + *(outbuffer + offset + 0) = (u_gravityRollError.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_gravityRollError.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_gravityRollError.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_gravityRollError.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->gravityRollError); + union { + float real; + uint32_t base; + } u_gravityPitchError; + u_gravityPitchError.real = this->gravityPitchError; + *(outbuffer + offset + 0) = (u_gravityPitchError.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_gravityPitchError.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_gravityPitchError.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_gravityPitchError.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->gravityPitchError); + *(outbuffer + offset + 0) = (this->localBundleIds_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->localBundleIds_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->localBundleIds_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->localBundleIds_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->localBundleIds_length); + for( uint32_t i = 0; i < localBundleIds_length; i++){ + union { + int32_t real; + uint32_t base; + } u_localBundleIdsi; + u_localBundleIdsi.real = this->localBundleIds[i]; + *(outbuffer + offset + 0) = (u_localBundleIdsi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_localBundleIdsi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_localBundleIdsi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_localBundleIdsi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->localBundleIds[i]); + } + *(outbuffer + offset + 0) = (this->localBundleModels_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->localBundleModels_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->localBundleModels_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->localBundleModels_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->localBundleModels_length); + for( uint32_t i = 0; i < localBundleModels_length; i++){ + offset += this->localBundleModels[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->localBundlePoses_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->localBundlePoses_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->localBundlePoses_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->localBundlePoses_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->localBundlePoses_length); + for( uint32_t i = 0; i < localBundlePoses_length; i++){ + offset += this->localBundlePoses[i].serialize(outbuffer + offset); + } + offset += this->transform.serialize(outbuffer + offset); + offset += this->transformFiltered.serialize(outbuffer + offset); + offset += this->transformGroundTruth.serialize(outbuffer + offset); + offset += this->guess.serialize(outbuffer + offset); + union { + int32_t real; + uint32_t base; + } u_type; + u_type.real = this->type; + *(outbuffer + offset + 0) = (u_type.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_type.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_type.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_type.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->type); + *(outbuffer + offset + 0) = (this->wordsKeys_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->wordsKeys_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->wordsKeys_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->wordsKeys_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->wordsKeys_length); + for( uint32_t i = 0; i < wordsKeys_length; i++){ + union { + int32_t real; + uint32_t base; + } u_wordsKeysi; + u_wordsKeysi.real = this->wordsKeys[i]; + *(outbuffer + offset + 0) = (u_wordsKeysi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_wordsKeysi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_wordsKeysi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_wordsKeysi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->wordsKeys[i]); + } + *(outbuffer + offset + 0) = (this->wordsValues_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->wordsValues_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->wordsValues_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->wordsValues_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->wordsValues_length); + for( uint32_t i = 0; i < wordsValues_length; i++){ + offset += this->wordsValues[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->wordMatches_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->wordMatches_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->wordMatches_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->wordMatches_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->wordMatches_length); + for( uint32_t i = 0; i < wordMatches_length; i++){ + union { + int32_t real; + uint32_t base; + } u_wordMatchesi; + u_wordMatchesi.real = this->wordMatches[i]; + *(outbuffer + offset + 0) = (u_wordMatchesi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_wordMatchesi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_wordMatchesi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_wordMatchesi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->wordMatches[i]); + } + *(outbuffer + offset + 0) = (this->wordInliers_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->wordInliers_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->wordInliers_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->wordInliers_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->wordInliers_length); + for( uint32_t i = 0; i < wordInliers_length; i++){ + union { + int32_t real; + uint32_t base; + } u_wordInliersi; + u_wordInliersi.real = this->wordInliers[i]; + *(outbuffer + offset + 0) = (u_wordInliersi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_wordInliersi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_wordInliersi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_wordInliersi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->wordInliers[i]); + } + *(outbuffer + offset + 0) = (this->localMapKeys_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->localMapKeys_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->localMapKeys_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->localMapKeys_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->localMapKeys_length); + for( uint32_t i = 0; i < localMapKeys_length; i++){ + union { + int32_t real; + uint32_t base; + } u_localMapKeysi; + u_localMapKeysi.real = this->localMapKeys[i]; + *(outbuffer + offset + 0) = (u_localMapKeysi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_localMapKeysi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_localMapKeysi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_localMapKeysi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->localMapKeys[i]); + } + *(outbuffer + offset + 0) = (this->localMapValues_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->localMapValues_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->localMapValues_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->localMapValues_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->localMapValues_length); + for( uint32_t i = 0; i < localMapValues_length; i++){ + offset += this->localMapValues[i].serialize(outbuffer + offset); + } + offset += this->localScanMap.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->refCorners_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->refCorners_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->refCorners_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->refCorners_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->refCorners_length); + for( uint32_t i = 0; i < refCorners_length; i++){ + offset += this->refCorners[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->newCorners_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->newCorners_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->newCorners_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->newCorners_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->newCorners_length); + for( uint32_t i = 0; i < newCorners_length; i++){ + offset += this->newCorners[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->cornerInliers_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->cornerInliers_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->cornerInliers_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->cornerInliers_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->cornerInliers_length); + for( uint32_t i = 0; i < cornerInliers_length; i++){ + union { + int32_t real; + uint32_t base; + } u_cornerInliersi; + u_cornerInliersi.real = this->cornerInliers[i]; + *(outbuffer + offset + 0) = (u_cornerInliersi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_cornerInliersi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_cornerInliersi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_cornerInliersi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->cornerInliers[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + union { + bool real; + uint8_t base; + } u_lost; + u_lost.base = 0; + u_lost.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->lost = u_lost.real; + offset += sizeof(this->lost); + union { + int32_t real; + uint32_t base; + } u_matches; + u_matches.base = 0; + u_matches.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_matches.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_matches.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_matches.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->matches = u_matches.real; + offset += sizeof(this->matches); + union { + int32_t real; + uint32_t base; + } u_inliers; + u_inliers.base = 0; + u_inliers.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_inliers.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_inliers.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_inliers.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->inliers = u_inliers.real; + offset += sizeof(this->inliers); + union { + float real; + uint32_t base; + } u_icpInliersRatio; + u_icpInliersRatio.base = 0; + u_icpInliersRatio.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_icpInliersRatio.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_icpInliersRatio.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_icpInliersRatio.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->icpInliersRatio = u_icpInliersRatio.real; + offset += sizeof(this->icpInliersRatio); + union { + float real; + uint32_t base; + } u_icpRotation; + u_icpRotation.base = 0; + u_icpRotation.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_icpRotation.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_icpRotation.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_icpRotation.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->icpRotation = u_icpRotation.real; + offset += sizeof(this->icpRotation); + union { + float real; + uint32_t base; + } u_icpTranslation; + u_icpTranslation.base = 0; + u_icpTranslation.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_icpTranslation.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_icpTranslation.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_icpTranslation.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->icpTranslation = u_icpTranslation.real; + offset += sizeof(this->icpTranslation); + union { + float real; + uint32_t base; + } u_icpStructuralComplexity; + u_icpStructuralComplexity.base = 0; + u_icpStructuralComplexity.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_icpStructuralComplexity.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_icpStructuralComplexity.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_icpStructuralComplexity.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->icpStructuralComplexity = u_icpStructuralComplexity.real; + offset += sizeof(this->icpStructuralComplexity); + union { + float real; + uint32_t base; + } u_icpStructuralDistribution; + u_icpStructuralDistribution.base = 0; + u_icpStructuralDistribution.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_icpStructuralDistribution.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_icpStructuralDistribution.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_icpStructuralDistribution.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->icpStructuralDistribution = u_icpStructuralDistribution.real; + offset += sizeof(this->icpStructuralDistribution); + union { + int32_t real; + uint32_t base; + } u_icpCorrespondences; + u_icpCorrespondences.base = 0; + u_icpCorrespondences.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_icpCorrespondences.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_icpCorrespondences.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_icpCorrespondences.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->icpCorrespondences = u_icpCorrespondences.real; + offset += sizeof(this->icpCorrespondences); + for( uint32_t i = 0; i < 36; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->covariance[i])); + } + union { + int32_t real; + uint32_t base; + } u_features; + u_features.base = 0; + u_features.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_features.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_features.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_features.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->features = u_features.real; + offset += sizeof(this->features); + union { + int32_t real; + uint32_t base; + } u_localMapSize; + u_localMapSize.base = 0; + u_localMapSize.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_localMapSize.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_localMapSize.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_localMapSize.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->localMapSize = u_localMapSize.real; + offset += sizeof(this->localMapSize); + union { + int32_t real; + uint32_t base; + } u_localScanMapSize; + u_localScanMapSize.base = 0; + u_localScanMapSize.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_localScanMapSize.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_localScanMapSize.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_localScanMapSize.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->localScanMapSize = u_localScanMapSize.real; + offset += sizeof(this->localScanMapSize); + union { + int32_t real; + uint32_t base; + } u_localKeyFrames; + u_localKeyFrames.base = 0; + u_localKeyFrames.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_localKeyFrames.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_localKeyFrames.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_localKeyFrames.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->localKeyFrames = u_localKeyFrames.real; + offset += sizeof(this->localKeyFrames); + union { + int32_t real; + uint32_t base; + } u_localBundleOutliers; + u_localBundleOutliers.base = 0; + u_localBundleOutliers.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_localBundleOutliers.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_localBundleOutliers.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_localBundleOutliers.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->localBundleOutliers = u_localBundleOutliers.real; + offset += sizeof(this->localBundleOutliers); + union { + int32_t real; + uint32_t base; + } u_localBundleConstraints; + u_localBundleConstraints.base = 0; + u_localBundleConstraints.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_localBundleConstraints.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_localBundleConstraints.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_localBundleConstraints.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->localBundleConstraints = u_localBundleConstraints.real; + offset += sizeof(this->localBundleConstraints); + union { + float real; + uint32_t base; + } u_localBundleTime; + u_localBundleTime.base = 0; + u_localBundleTime.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_localBundleTime.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_localBundleTime.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_localBundleTime.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->localBundleTime = u_localBundleTime.real; + offset += sizeof(this->localBundleTime); + union { + float real; + uint32_t base; + } u_localBundleAvgInlierDistance; + u_localBundleAvgInlierDistance.base = 0; + u_localBundleAvgInlierDistance.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_localBundleAvgInlierDistance.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_localBundleAvgInlierDistance.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_localBundleAvgInlierDistance.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->localBundleAvgInlierDistance = u_localBundleAvgInlierDistance.real; + offset += sizeof(this->localBundleAvgInlierDistance); + union { + int32_t real; + uint32_t base; + } u_localBundleMaxKeyFramesForInlier; + u_localBundleMaxKeyFramesForInlier.base = 0; + u_localBundleMaxKeyFramesForInlier.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_localBundleMaxKeyFramesForInlier.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_localBundleMaxKeyFramesForInlier.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_localBundleMaxKeyFramesForInlier.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->localBundleMaxKeyFramesForInlier = u_localBundleMaxKeyFramesForInlier.real; + offset += sizeof(this->localBundleMaxKeyFramesForInlier); + union { + bool real; + uint8_t base; + } u_keyFrameAdded; + u_keyFrameAdded.base = 0; + u_keyFrameAdded.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->keyFrameAdded = u_keyFrameAdded.real; + offset += sizeof(this->keyFrameAdded); + union { + float real; + uint32_t base; + } u_timeEstimation; + u_timeEstimation.base = 0; + u_timeEstimation.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_timeEstimation.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_timeEstimation.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_timeEstimation.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->timeEstimation = u_timeEstimation.real; + offset += sizeof(this->timeEstimation); + union { + float real; + uint32_t base; + } u_timeParticleFiltering; + u_timeParticleFiltering.base = 0; + u_timeParticleFiltering.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_timeParticleFiltering.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_timeParticleFiltering.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_timeParticleFiltering.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->timeParticleFiltering = u_timeParticleFiltering.real; + offset += sizeof(this->timeParticleFiltering); + union { + float real; + uint32_t base; + } u_stamp; + u_stamp.base = 0; + u_stamp.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_stamp.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_stamp.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_stamp.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->stamp = u_stamp.real; + offset += sizeof(this->stamp); + union { + float real; + uint32_t base; + } u_interval; + u_interval.base = 0; + u_interval.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_interval.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_interval.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_interval.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->interval = u_interval.real; + offset += sizeof(this->interval); + union { + float real; + uint32_t base; + } u_distanceTravelled; + u_distanceTravelled.base = 0; + u_distanceTravelled.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_distanceTravelled.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_distanceTravelled.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_distanceTravelled.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->distanceTravelled = u_distanceTravelled.real; + offset += sizeof(this->distanceTravelled); + union { + int32_t real; + uint32_t base; + } u_memoryUsage; + u_memoryUsage.base = 0; + u_memoryUsage.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_memoryUsage.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_memoryUsage.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_memoryUsage.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->memoryUsage = u_memoryUsage.real; + offset += sizeof(this->memoryUsage); + union { + float real; + uint32_t base; + } u_gravityRollError; + u_gravityRollError.base = 0; + u_gravityRollError.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_gravityRollError.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_gravityRollError.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_gravityRollError.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->gravityRollError = u_gravityRollError.real; + offset += sizeof(this->gravityRollError); + union { + float real; + uint32_t base; + } u_gravityPitchError; + u_gravityPitchError.base = 0; + u_gravityPitchError.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_gravityPitchError.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_gravityPitchError.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_gravityPitchError.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->gravityPitchError = u_gravityPitchError.real; + offset += sizeof(this->gravityPitchError); + uint32_t localBundleIds_lengthT = ((uint32_t) (*(inbuffer + offset))); + localBundleIds_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + localBundleIds_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + localBundleIds_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->localBundleIds_length); + if(localBundleIds_lengthT > localBundleIds_length) + this->localBundleIds = (int32_t*)realloc(this->localBundleIds, localBundleIds_lengthT * sizeof(int32_t)); + localBundleIds_length = localBundleIds_lengthT; + for( uint32_t i = 0; i < localBundleIds_length; i++){ + union { + int32_t real; + uint32_t base; + } u_st_localBundleIds; + u_st_localBundleIds.base = 0; + u_st_localBundleIds.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_localBundleIds.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_localBundleIds.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_localBundleIds.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_localBundleIds = u_st_localBundleIds.real; + offset += sizeof(this->st_localBundleIds); + memcpy( &(this->localBundleIds[i]), &(this->st_localBundleIds), sizeof(int32_t)); + } + uint32_t localBundleModels_lengthT = ((uint32_t) (*(inbuffer + offset))); + localBundleModels_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + localBundleModels_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + localBundleModels_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->localBundleModels_length); + if(localBundleModels_lengthT > localBundleModels_length) + this->localBundleModels = (rtabmap_msgs::CameraModels*)realloc(this->localBundleModels, localBundleModels_lengthT * sizeof(rtabmap_msgs::CameraModels)); + localBundleModels_length = localBundleModels_lengthT; + for( uint32_t i = 0; i < localBundleModels_length; i++){ + offset += this->st_localBundleModels.deserialize(inbuffer + offset); + memcpy( &(this->localBundleModels[i]), &(this->st_localBundleModels), sizeof(rtabmap_msgs::CameraModels)); + } + uint32_t localBundlePoses_lengthT = ((uint32_t) (*(inbuffer + offset))); + localBundlePoses_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + localBundlePoses_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + localBundlePoses_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->localBundlePoses_length); + if(localBundlePoses_lengthT > localBundlePoses_length) + this->localBundlePoses = (geometry_msgs::Pose*)realloc(this->localBundlePoses, localBundlePoses_lengthT * sizeof(geometry_msgs::Pose)); + localBundlePoses_length = localBundlePoses_lengthT; + for( uint32_t i = 0; i < localBundlePoses_length; i++){ + offset += this->st_localBundlePoses.deserialize(inbuffer + offset); + memcpy( &(this->localBundlePoses[i]), &(this->st_localBundlePoses), sizeof(geometry_msgs::Pose)); + } + offset += this->transform.deserialize(inbuffer + offset); + offset += this->transformFiltered.deserialize(inbuffer + offset); + offset += this->transformGroundTruth.deserialize(inbuffer + offset); + offset += this->guess.deserialize(inbuffer + offset); + union { + int32_t real; + uint32_t base; + } u_type; + u_type.base = 0; + u_type.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_type.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_type.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_type.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->type = u_type.real; + offset += sizeof(this->type); + uint32_t wordsKeys_lengthT = ((uint32_t) (*(inbuffer + offset))); + wordsKeys_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + wordsKeys_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + wordsKeys_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->wordsKeys_length); + if(wordsKeys_lengthT > wordsKeys_length) + this->wordsKeys = (int32_t*)realloc(this->wordsKeys, wordsKeys_lengthT * sizeof(int32_t)); + wordsKeys_length = wordsKeys_lengthT; + for( uint32_t i = 0; i < wordsKeys_length; i++){ + union { + int32_t real; + uint32_t base; + } u_st_wordsKeys; + u_st_wordsKeys.base = 0; + u_st_wordsKeys.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_wordsKeys.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_wordsKeys.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_wordsKeys.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_wordsKeys = u_st_wordsKeys.real; + offset += sizeof(this->st_wordsKeys); + memcpy( &(this->wordsKeys[i]), &(this->st_wordsKeys), sizeof(int32_t)); + } + uint32_t wordsValues_lengthT = ((uint32_t) (*(inbuffer + offset))); + wordsValues_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + wordsValues_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + wordsValues_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->wordsValues_length); + if(wordsValues_lengthT > wordsValues_length) + this->wordsValues = (rtabmap_msgs::KeyPoint*)realloc(this->wordsValues, wordsValues_lengthT * sizeof(rtabmap_msgs::KeyPoint)); + wordsValues_length = wordsValues_lengthT; + for( uint32_t i = 0; i < wordsValues_length; i++){ + offset += this->st_wordsValues.deserialize(inbuffer + offset); + memcpy( &(this->wordsValues[i]), &(this->st_wordsValues), sizeof(rtabmap_msgs::KeyPoint)); + } + uint32_t wordMatches_lengthT = ((uint32_t) (*(inbuffer + offset))); + wordMatches_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + wordMatches_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + wordMatches_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->wordMatches_length); + if(wordMatches_lengthT > wordMatches_length) + this->wordMatches = (int32_t*)realloc(this->wordMatches, wordMatches_lengthT * sizeof(int32_t)); + wordMatches_length = wordMatches_lengthT; + for( uint32_t i = 0; i < wordMatches_length; i++){ + union { + int32_t real; + uint32_t base; + } u_st_wordMatches; + u_st_wordMatches.base = 0; + u_st_wordMatches.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_wordMatches.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_wordMatches.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_wordMatches.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_wordMatches = u_st_wordMatches.real; + offset += sizeof(this->st_wordMatches); + memcpy( &(this->wordMatches[i]), &(this->st_wordMatches), sizeof(int32_t)); + } + uint32_t wordInliers_lengthT = ((uint32_t) (*(inbuffer + offset))); + wordInliers_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + wordInliers_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + wordInliers_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->wordInliers_length); + if(wordInliers_lengthT > wordInliers_length) + this->wordInliers = (int32_t*)realloc(this->wordInliers, wordInliers_lengthT * sizeof(int32_t)); + wordInliers_length = wordInliers_lengthT; + for( uint32_t i = 0; i < wordInliers_length; i++){ + union { + int32_t real; + uint32_t base; + } u_st_wordInliers; + u_st_wordInliers.base = 0; + u_st_wordInliers.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_wordInliers.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_wordInliers.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_wordInliers.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_wordInliers = u_st_wordInliers.real; + offset += sizeof(this->st_wordInliers); + memcpy( &(this->wordInliers[i]), &(this->st_wordInliers), sizeof(int32_t)); + } + uint32_t localMapKeys_lengthT = ((uint32_t) (*(inbuffer + offset))); + localMapKeys_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + localMapKeys_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + localMapKeys_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->localMapKeys_length); + if(localMapKeys_lengthT > localMapKeys_length) + this->localMapKeys = (int32_t*)realloc(this->localMapKeys, localMapKeys_lengthT * sizeof(int32_t)); + localMapKeys_length = localMapKeys_lengthT; + for( uint32_t i = 0; i < localMapKeys_length; i++){ + union { + int32_t real; + uint32_t base; + } u_st_localMapKeys; + u_st_localMapKeys.base = 0; + u_st_localMapKeys.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_localMapKeys.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_localMapKeys.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_localMapKeys.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_localMapKeys = u_st_localMapKeys.real; + offset += sizeof(this->st_localMapKeys); + memcpy( &(this->localMapKeys[i]), &(this->st_localMapKeys), sizeof(int32_t)); + } + uint32_t localMapValues_lengthT = ((uint32_t) (*(inbuffer + offset))); + localMapValues_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + localMapValues_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + localMapValues_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->localMapValues_length); + if(localMapValues_lengthT > localMapValues_length) + this->localMapValues = (rtabmap_msgs::Point3f*)realloc(this->localMapValues, localMapValues_lengthT * sizeof(rtabmap_msgs::Point3f)); + localMapValues_length = localMapValues_lengthT; + for( uint32_t i = 0; i < localMapValues_length; i++){ + offset += this->st_localMapValues.deserialize(inbuffer + offset); + memcpy( &(this->localMapValues[i]), &(this->st_localMapValues), sizeof(rtabmap_msgs::Point3f)); + } + offset += this->localScanMap.deserialize(inbuffer + offset); + uint32_t refCorners_lengthT = ((uint32_t) (*(inbuffer + offset))); + refCorners_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + refCorners_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + refCorners_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->refCorners_length); + if(refCorners_lengthT > refCorners_length) + this->refCorners = (rtabmap_msgs::Point2f*)realloc(this->refCorners, refCorners_lengthT * sizeof(rtabmap_msgs::Point2f)); + refCorners_length = refCorners_lengthT; + for( uint32_t i = 0; i < refCorners_length; i++){ + offset += this->st_refCorners.deserialize(inbuffer + offset); + memcpy( &(this->refCorners[i]), &(this->st_refCorners), sizeof(rtabmap_msgs::Point2f)); + } + uint32_t newCorners_lengthT = ((uint32_t) (*(inbuffer + offset))); + newCorners_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + newCorners_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + newCorners_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->newCorners_length); + if(newCorners_lengthT > newCorners_length) + this->newCorners = (rtabmap_msgs::Point2f*)realloc(this->newCorners, newCorners_lengthT * sizeof(rtabmap_msgs::Point2f)); + newCorners_length = newCorners_lengthT; + for( uint32_t i = 0; i < newCorners_length; i++){ + offset += this->st_newCorners.deserialize(inbuffer + offset); + memcpy( &(this->newCorners[i]), &(this->st_newCorners), sizeof(rtabmap_msgs::Point2f)); + } + uint32_t cornerInliers_lengthT = ((uint32_t) (*(inbuffer + offset))); + cornerInliers_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + cornerInliers_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + cornerInliers_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->cornerInliers_length); + if(cornerInliers_lengthT > cornerInliers_length) + this->cornerInliers = (int32_t*)realloc(this->cornerInliers, cornerInliers_lengthT * sizeof(int32_t)); + cornerInliers_length = cornerInliers_lengthT; + for( uint32_t i = 0; i < cornerInliers_length; i++){ + union { + int32_t real; + uint32_t base; + } u_st_cornerInliers; + u_st_cornerInliers.base = 0; + u_st_cornerInliers.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_cornerInliers.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_cornerInliers.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_cornerInliers.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_cornerInliers = u_st_cornerInliers.real; + offset += sizeof(this->st_cornerInliers); + memcpy( &(this->cornerInliers[i]), &(this->st_cornerInliers), sizeof(int32_t)); + } + return offset; + } + + virtual const char * getType() override { return "rtabmap_msgs/OdomInfo"; }; + virtual const char * getMD5() override { return "9a9c97dc6c27f8a4f2a53d9cd23d41d7"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/rtabmap_msgs/Path.h b/pio_workspace/lib/ros_lib/rtabmap_msgs/Path.h new file mode 100644 index 0000000..d54f706 --- /dev/null +++ b/pio_workspace/lib/ros_lib/rtabmap_msgs/Path.h @@ -0,0 +1,114 @@ +#ifndef _ROS_rtabmap_msgs_Path_h +#define _ROS_rtabmap_msgs_Path_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Pose.h" + +namespace rtabmap_msgs +{ + + class Path : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t nodeIds_length; + typedef int32_t _nodeIds_type; + _nodeIds_type st_nodeIds; + _nodeIds_type * nodeIds; + uint32_t poses_length; + typedef geometry_msgs::Pose _poses_type; + _poses_type st_poses; + _poses_type * poses; + + Path(): + header(), + nodeIds_length(0), st_nodeIds(), nodeIds(nullptr), + poses_length(0), st_poses(), poses(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->nodeIds_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->nodeIds_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->nodeIds_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->nodeIds_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->nodeIds_length); + for( uint32_t i = 0; i < nodeIds_length; i++){ + union { + int32_t real; + uint32_t base; + } u_nodeIdsi; + u_nodeIdsi.real = this->nodeIds[i]; + *(outbuffer + offset + 0) = (u_nodeIdsi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_nodeIdsi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_nodeIdsi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_nodeIdsi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->nodeIds[i]); + } + *(outbuffer + offset + 0) = (this->poses_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->poses_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->poses_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->poses_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->poses_length); + for( uint32_t i = 0; i < poses_length; i++){ + offset += this->poses[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t nodeIds_lengthT = ((uint32_t) (*(inbuffer + offset))); + nodeIds_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + nodeIds_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + nodeIds_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->nodeIds_length); + if(nodeIds_lengthT > nodeIds_length) + this->nodeIds = (int32_t*)realloc(this->nodeIds, nodeIds_lengthT * sizeof(int32_t)); + nodeIds_length = nodeIds_lengthT; + for( uint32_t i = 0; i < nodeIds_length; i++){ + union { + int32_t real; + uint32_t base; + } u_st_nodeIds; + u_st_nodeIds.base = 0; + u_st_nodeIds.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_nodeIds.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_nodeIds.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_nodeIds.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_nodeIds = u_st_nodeIds.real; + offset += sizeof(this->st_nodeIds); + memcpy( &(this->nodeIds[i]), &(this->st_nodeIds), sizeof(int32_t)); + } + uint32_t poses_lengthT = ((uint32_t) (*(inbuffer + offset))); + poses_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + poses_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + poses_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->poses_length); + if(poses_lengthT > poses_length) + this->poses = (geometry_msgs::Pose*)realloc(this->poses, poses_lengthT * sizeof(geometry_msgs::Pose)); + poses_length = poses_lengthT; + for( uint32_t i = 0; i < poses_length; i++){ + offset += this->st_poses.deserialize(inbuffer + offset); + memcpy( &(this->poses[i]), &(this->st_poses), sizeof(geometry_msgs::Pose)); + } + return offset; + } + + virtual const char * getType() override { return "rtabmap_msgs/Path"; }; + virtual const char * getMD5() override { return "ce3513b544acee43df74e3869c3272c0"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/rtabmap_msgs/Point2f.h b/pio_workspace/lib/ros_lib/rtabmap_msgs/Point2f.h new file mode 100644 index 0000000..90954b4 --- /dev/null +++ b/pio_workspace/lib/ros_lib/rtabmap_msgs/Point2f.h @@ -0,0 +1,86 @@ +#ifndef _ROS_rtabmap_msgs_Point2f_h +#define _ROS_rtabmap_msgs_Point2f_h + +#include +#include +#include +#include "ros/msg.h" + +namespace rtabmap_msgs +{ + + class Point2f : public ros::Msg + { + public: + typedef float _x_type; + _x_type x; + typedef float _y_type; + _y_type y; + + Point2f(): + x(0), + y(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + float real; + uint32_t base; + } u_x; + u_x.real = this->x; + *(outbuffer + offset + 0) = (u_x.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_x.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_x.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_x.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->x); + union { + float real; + uint32_t base; + } u_y; + u_y.real = this->y; + *(outbuffer + offset + 0) = (u_y.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_y.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_y.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_y.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->y); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + float real; + uint32_t base; + } u_x; + u_x.base = 0; + u_x.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->x = u_x.real; + offset += sizeof(this->x); + union { + float real; + uint32_t base; + } u_y; + u_y.base = 0; + u_y.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->y = u_y.real; + offset += sizeof(this->y); + return offset; + } + + virtual const char * getType() override { return "rtabmap_msgs/Point2f"; }; + virtual const char * getMD5() override { return "ff8d7d66dd3e4b731ef14a45d38888b6"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/turtlesim/TeleportAbsolute.h b/pio_workspace/lib/ros_lib/rtabmap_msgs/Point3f.h similarity index 53% rename from pio_workspace/lib/ros_lib/turtlesim/TeleportAbsolute.h rename to pio_workspace/lib/ros_lib/rtabmap_msgs/Point3f.h index 6369965..5e0dae9 100644 --- a/pio_workspace/lib/ros_lib/turtlesim/TeleportAbsolute.h +++ b/pio_workspace/lib/ros_lib/rtabmap_msgs/Point3f.h @@ -1,29 +1,28 @@ -#ifndef _ROS_SERVICE_TeleportAbsolute_h -#define _ROS_SERVICE_TeleportAbsolute_h +#ifndef _ROS_rtabmap_msgs_Point3f_h +#define _ROS_rtabmap_msgs_Point3f_h + #include #include #include #include "ros/msg.h" -namespace turtlesim +namespace rtabmap_msgs { -static const char TELEPORTABSOLUTE[] = "turtlesim/TeleportAbsolute"; - - class TeleportAbsoluteRequest : public ros::Msg + class Point3f : public ros::Msg { public: typedef float _x_type; _x_type x; typedef float _y_type; _y_type y; - typedef float _theta_type; - _theta_type theta; + typedef float _z_type; + _z_type z; - TeleportAbsoluteRequest(): + Point3f(): x(0), y(0), - theta(0) + z(0) { } @@ -53,13 +52,13 @@ static const char TELEPORTABSOLUTE[] = "turtlesim/TeleportAbsolute"; union { float real; uint32_t base; - } u_theta; - u_theta.real = this->theta; - *(outbuffer + offset + 0) = (u_theta.base >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (u_theta.base >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (u_theta.base >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (u_theta.base >> (8 * 3)) & 0xFF; - offset += sizeof(this->theta); + } u_z; + u_z.real = this->z; + *(outbuffer + offset + 0) = (u_z.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_z.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_z.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_z.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->z); return offset; } @@ -91,52 +90,21 @@ static const char TELEPORTABSOLUTE[] = "turtlesim/TeleportAbsolute"; union { float real; uint32_t base; - } u_theta; - u_theta.base = 0; - u_theta.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); - u_theta.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - u_theta.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - u_theta.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - this->theta = u_theta.real; - offset += sizeof(this->theta); - return offset; - } - - virtual const char * getType() override { return TELEPORTABSOLUTE; }; - virtual const char * getMD5() override { return "a130bc60ee6513855dc62ea83fcc5b20"; }; - - }; - - class TeleportAbsoluteResponse : public ros::Msg - { - public: - - TeleportAbsoluteResponse() - { - } - - virtual int serialize(unsigned char *outbuffer) const override - { - int offset = 0; - return offset; - } - - virtual int deserialize(unsigned char *inbuffer) override - { - int offset = 0; + } u_z; + u_z.base = 0; + u_z.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_z.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_z.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_z.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->z = u_z.real; + offset += sizeof(this->z); return offset; } - virtual const char * getType() override { return TELEPORTABSOLUTE; }; - virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + virtual const char * getType() override { return "rtabmap_msgs/Point3f"; }; + virtual const char * getMD5() override { return "cc153912f1453b708d221682bc23d9ac"; }; }; - class TeleportAbsolute { - public: - typedef TeleportAbsoluteRequest Request; - typedef TeleportAbsoluteResponse Response; - }; - } #endif diff --git a/pio_workspace/lib/ros_lib/rtabmap_msgs/PublishMap.h b/pio_workspace/lib/ros_lib/rtabmap_msgs/PublishMap.h new file mode 100644 index 0000000..68013e5 --- /dev/null +++ b/pio_workspace/lib/ros_lib/rtabmap_msgs/PublishMap.h @@ -0,0 +1,124 @@ +#ifndef _ROS_SERVICE_PublishMap_h +#define _ROS_SERVICE_PublishMap_h +#include +#include +#include +#include "ros/msg.h" + +namespace rtabmap_msgs +{ + +static const char PUBLISHMAP[] = "rtabmap_msgs/PublishMap"; + + class PublishMapRequest : public ros::Msg + { + public: + typedef bool _global_type; + _global_type global; + typedef bool _optimized_type; + _optimized_type optimized; + typedef bool _graphOnly_type; + _graphOnly_type graphOnly; + + PublishMapRequest(): + global(0), + optimized(0), + graphOnly(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_global; + u_global.real = this->global; + *(outbuffer + offset + 0) = (u_global.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->global); + union { + bool real; + uint8_t base; + } u_optimized; + u_optimized.real = this->optimized; + *(outbuffer + offset + 0) = (u_optimized.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->optimized); + union { + bool real; + uint8_t base; + } u_graphOnly; + u_graphOnly.real = this->graphOnly; + *(outbuffer + offset + 0) = (u_graphOnly.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->graphOnly); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_global; + u_global.base = 0; + u_global.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->global = u_global.real; + offset += sizeof(this->global); + union { + bool real; + uint8_t base; + } u_optimized; + u_optimized.base = 0; + u_optimized.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->optimized = u_optimized.real; + offset += sizeof(this->optimized); + union { + bool real; + uint8_t base; + } u_graphOnly; + u_graphOnly.base = 0; + u_graphOnly.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->graphOnly = u_graphOnly.real; + offset += sizeof(this->graphOnly); + return offset; + } + + virtual const char * getType() override { return PUBLISHMAP; }; + virtual const char * getMD5() override { return "6213f9f13cced23f4d224b22f59d839c"; }; + + }; + + class PublishMapResponse : public ros::Msg + { + public: + + PublishMapResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + return offset; + } + + virtual const char * getType() override { return PUBLISHMAP; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class PublishMap { + public: + typedef PublishMapRequest Request; + typedef PublishMapResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/rtabmap_msgs/RGBDImage.h b/pio_workspace/lib/ros_lib/rtabmap_msgs/RGBDImage.h new file mode 100644 index 0000000..ce19706 --- /dev/null +++ b/pio_workspace/lib/ros_lib/rtabmap_msgs/RGBDImage.h @@ -0,0 +1,162 @@ +#ifndef _ROS_rtabmap_msgs_RGBDImage_h +#define _ROS_rtabmap_msgs_RGBDImage_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "sensor_msgs/CameraInfo.h" +#include "sensor_msgs/Image.h" +#include "sensor_msgs/CompressedImage.h" +#include "rtabmap_msgs/KeyPoint.h" +#include "rtabmap_msgs/Point3f.h" +#include "rtabmap_msgs/GlobalDescriptor.h" + +namespace rtabmap_msgs +{ + + class RGBDImage : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef sensor_msgs::CameraInfo _rgb_camera_info_type; + _rgb_camera_info_type rgb_camera_info; + typedef sensor_msgs::CameraInfo _depth_camera_info_type; + _depth_camera_info_type depth_camera_info; + typedef sensor_msgs::Image _rgb_type; + _rgb_type rgb; + typedef sensor_msgs::Image _depth_type; + _depth_type depth; + typedef sensor_msgs::CompressedImage _rgb_compressed_type; + _rgb_compressed_type rgb_compressed; + typedef sensor_msgs::CompressedImage _depth_compressed_type; + _depth_compressed_type depth_compressed; + uint32_t key_points_length; + typedef rtabmap_msgs::KeyPoint _key_points_type; + _key_points_type st_key_points; + _key_points_type * key_points; + uint32_t points_length; + typedef rtabmap_msgs::Point3f _points_type; + _points_type st_points; + _points_type * points; + uint32_t descriptors_length; + typedef uint8_t _descriptors_type; + _descriptors_type st_descriptors; + _descriptors_type * descriptors; + typedef rtabmap_msgs::GlobalDescriptor _global_descriptor_type; + _global_descriptor_type global_descriptor; + + RGBDImage(): + header(), + rgb_camera_info(), + depth_camera_info(), + rgb(), + depth(), + rgb_compressed(), + depth_compressed(), + key_points_length(0), st_key_points(), key_points(nullptr), + points_length(0), st_points(), points(nullptr), + descriptors_length(0), st_descriptors(), descriptors(nullptr), + global_descriptor() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->rgb_camera_info.serialize(outbuffer + offset); + offset += this->depth_camera_info.serialize(outbuffer + offset); + offset += this->rgb.serialize(outbuffer + offset); + offset += this->depth.serialize(outbuffer + offset); + offset += this->rgb_compressed.serialize(outbuffer + offset); + offset += this->depth_compressed.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->key_points_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->key_points_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->key_points_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->key_points_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->key_points_length); + for( uint32_t i = 0; i < key_points_length; i++){ + offset += this->key_points[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->points_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->points_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->points_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->points_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->points_length); + for( uint32_t i = 0; i < points_length; i++){ + offset += this->points[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->descriptors_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->descriptors_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->descriptors_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->descriptors_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->descriptors_length); + for( uint32_t i = 0; i < descriptors_length; i++){ + *(outbuffer + offset + 0) = (this->descriptors[i] >> (8 * 0)) & 0xFF; + offset += sizeof(this->descriptors[i]); + } + offset += this->global_descriptor.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->rgb_camera_info.deserialize(inbuffer + offset); + offset += this->depth_camera_info.deserialize(inbuffer + offset); + offset += this->rgb.deserialize(inbuffer + offset); + offset += this->depth.deserialize(inbuffer + offset); + offset += this->rgb_compressed.deserialize(inbuffer + offset); + offset += this->depth_compressed.deserialize(inbuffer + offset); + uint32_t key_points_lengthT = ((uint32_t) (*(inbuffer + offset))); + key_points_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + key_points_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + key_points_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->key_points_length); + if(key_points_lengthT > key_points_length) + this->key_points = (rtabmap_msgs::KeyPoint*)realloc(this->key_points, key_points_lengthT * sizeof(rtabmap_msgs::KeyPoint)); + key_points_length = key_points_lengthT; + for( uint32_t i = 0; i < key_points_length; i++){ + offset += this->st_key_points.deserialize(inbuffer + offset); + memcpy( &(this->key_points[i]), &(this->st_key_points), sizeof(rtabmap_msgs::KeyPoint)); + } + uint32_t points_lengthT = ((uint32_t) (*(inbuffer + offset))); + points_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + points_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + points_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->points_length); + if(points_lengthT > points_length) + this->points = (rtabmap_msgs::Point3f*)realloc(this->points, points_lengthT * sizeof(rtabmap_msgs::Point3f)); + points_length = points_lengthT; + for( uint32_t i = 0; i < points_length; i++){ + offset += this->st_points.deserialize(inbuffer + offset); + memcpy( &(this->points[i]), &(this->st_points), sizeof(rtabmap_msgs::Point3f)); + } + uint32_t descriptors_lengthT = ((uint32_t) (*(inbuffer + offset))); + descriptors_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + descriptors_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + descriptors_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->descriptors_length); + if(descriptors_lengthT > descriptors_length) + this->descriptors = (uint8_t*)realloc(this->descriptors, descriptors_lengthT * sizeof(uint8_t)); + descriptors_length = descriptors_lengthT; + for( uint32_t i = 0; i < descriptors_length; i++){ + this->st_descriptors = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->st_descriptors); + memcpy( &(this->descriptors[i]), &(this->st_descriptors), sizeof(uint8_t)); + } + offset += this->global_descriptor.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "rtabmap_msgs/RGBDImage"; }; + virtual const char * getMD5() override { return "affef6cc8804ffba98ce6ed6f1ca8942"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/rtabmap_msgs/RGBDImages.h b/pio_workspace/lib/ros_lib/rtabmap_msgs/RGBDImages.h new file mode 100644 index 0000000..764021a --- /dev/null +++ b/pio_workspace/lib/ros_lib/rtabmap_msgs/RGBDImages.h @@ -0,0 +1,70 @@ +#ifndef _ROS_rtabmap_msgs_RGBDImages_h +#define _ROS_rtabmap_msgs_RGBDImages_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "rtabmap_msgs/RGBDImage.h" + +namespace rtabmap_msgs +{ + + class RGBDImages : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t rgbd_images_length; + typedef rtabmap_msgs::RGBDImage _rgbd_images_type; + _rgbd_images_type st_rgbd_images; + _rgbd_images_type * rgbd_images; + + RGBDImages(): + header(), + rgbd_images_length(0), st_rgbd_images(), rgbd_images(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->rgbd_images_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->rgbd_images_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->rgbd_images_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->rgbd_images_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->rgbd_images_length); + for( uint32_t i = 0; i < rgbd_images_length; i++){ + offset += this->rgbd_images[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t rgbd_images_lengthT = ((uint32_t) (*(inbuffer + offset))); + rgbd_images_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + rgbd_images_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + rgbd_images_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->rgbd_images_length); + if(rgbd_images_lengthT > rgbd_images_length) + this->rgbd_images = (rtabmap_msgs::RGBDImage*)realloc(this->rgbd_images, rgbd_images_lengthT * sizeof(rtabmap_msgs::RGBDImage)); + rgbd_images_length = rgbd_images_lengthT; + for( uint32_t i = 0; i < rgbd_images_length; i++){ + offset += this->st_rgbd_images.deserialize(inbuffer + offset); + memcpy( &(this->rgbd_images[i]), &(this->st_rgbd_images), sizeof(rtabmap_msgs::RGBDImage)); + } + return offset; + } + + virtual const char * getType() override { return "rtabmap_msgs/RGBDImages"; }; + virtual const char * getMD5() override { return "aea27d3dc751e4501a1992b6fb5ad47e"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/rtabmap_msgs/RemoveLabel.h b/pio_workspace/lib/ros_lib/rtabmap_msgs/RemoveLabel.h new file mode 100644 index 0000000..984e053 --- /dev/null +++ b/pio_workspace/lib/ros_lib/rtabmap_msgs/RemoveLabel.h @@ -0,0 +1,87 @@ +#ifndef _ROS_SERVICE_RemoveLabel_h +#define _ROS_SERVICE_RemoveLabel_h +#include +#include +#include +#include "ros/msg.h" + +namespace rtabmap_msgs +{ + +static const char REMOVELABEL[] = "rtabmap_msgs/RemoveLabel"; + + class RemoveLabelRequest : public ros::Msg + { + public: + typedef const char* _label_type; + _label_type label; + + RemoveLabelRequest(): + label("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_label = strlen(this->label); + varToArr(outbuffer + offset, length_label); + offset += 4; + memcpy(outbuffer + offset, this->label, length_label); + offset += length_label; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_label; + arrToVar(length_label, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_label; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_label-1]=0; + this->label = (char *)(inbuffer + offset-1); + offset += length_label; + return offset; + } + + virtual const char * getType() override { return REMOVELABEL; }; + virtual const char * getMD5() override { return "ea23f97416b04c6151d2b576c0665ac1"; }; + + }; + + class RemoveLabelResponse : public ros::Msg + { + public: + + RemoveLabelResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + return offset; + } + + virtual const char * getType() override { return REMOVELABEL; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class RemoveLabel { + public: + typedef RemoveLabelRequest Request; + typedef RemoveLabelResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/rtabmap_msgs/ResetPose.h b/pio_workspace/lib/ros_lib/rtabmap_msgs/ResetPose.h new file mode 100644 index 0000000..06e0063 --- /dev/null +++ b/pio_workspace/lib/ros_lib/rtabmap_msgs/ResetPose.h @@ -0,0 +1,214 @@ +#ifndef _ROS_SERVICE_ResetPose_h +#define _ROS_SERVICE_ResetPose_h +#include +#include +#include +#include "ros/msg.h" + +namespace rtabmap_msgs +{ + +static const char RESETPOSE[] = "rtabmap_msgs/ResetPose"; + + class ResetPoseRequest : public ros::Msg + { + public: + typedef float _x_type; + _x_type x; + typedef float _y_type; + _y_type y; + typedef float _z_type; + _z_type z; + typedef float _roll_type; + _roll_type roll; + typedef float _pitch_type; + _pitch_type pitch; + typedef float _yaw_type; + _yaw_type yaw; + + ResetPoseRequest(): + x(0), + y(0), + z(0), + roll(0), + pitch(0), + yaw(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + float real; + uint32_t base; + } u_x; + u_x.real = this->x; + *(outbuffer + offset + 0) = (u_x.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_x.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_x.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_x.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->x); + union { + float real; + uint32_t base; + } u_y; + u_y.real = this->y; + *(outbuffer + offset + 0) = (u_y.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_y.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_y.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_y.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->y); + union { + float real; + uint32_t base; + } u_z; + u_z.real = this->z; + *(outbuffer + offset + 0) = (u_z.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_z.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_z.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_z.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->z); + union { + float real; + uint32_t base; + } u_roll; + u_roll.real = this->roll; + *(outbuffer + offset + 0) = (u_roll.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_roll.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_roll.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_roll.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->roll); + union { + float real; + uint32_t base; + } u_pitch; + u_pitch.real = this->pitch; + *(outbuffer + offset + 0) = (u_pitch.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_pitch.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_pitch.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_pitch.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->pitch); + union { + float real; + uint32_t base; + } u_yaw; + u_yaw.real = this->yaw; + *(outbuffer + offset + 0) = (u_yaw.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_yaw.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_yaw.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_yaw.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->yaw); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + float real; + uint32_t base; + } u_x; + u_x.base = 0; + u_x.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->x = u_x.real; + offset += sizeof(this->x); + union { + float real; + uint32_t base; + } u_y; + u_y.base = 0; + u_y.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->y = u_y.real; + offset += sizeof(this->y); + union { + float real; + uint32_t base; + } u_z; + u_z.base = 0; + u_z.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_z.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_z.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_z.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->z = u_z.real; + offset += sizeof(this->z); + union { + float real; + uint32_t base; + } u_roll; + u_roll.base = 0; + u_roll.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_roll.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_roll.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_roll.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->roll = u_roll.real; + offset += sizeof(this->roll); + union { + float real; + uint32_t base; + } u_pitch; + u_pitch.base = 0; + u_pitch.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_pitch.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_pitch.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_pitch.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->pitch = u_pitch.real; + offset += sizeof(this->pitch); + union { + float real; + uint32_t base; + } u_yaw; + u_yaw.base = 0; + u_yaw.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_yaw.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_yaw.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_yaw.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->yaw = u_yaw.real; + offset += sizeof(this->yaw); + return offset; + } + + virtual const char * getType() override { return RESETPOSE; }; + virtual const char * getMD5() override { return "3d5697f0c9e8859325238b57521f8f4e"; }; + + }; + + class ResetPoseResponse : public ros::Msg + { + public: + + ResetPoseResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + return offset; + } + + virtual const char * getType() override { return RESETPOSE; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class ResetPose { + public: + typedef ResetPoseRequest Request; + typedef ResetPoseResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/rtabmap_msgs/ScanDescriptor.h b/pio_workspace/lib/ros_lib/rtabmap_msgs/ScanDescriptor.h new file mode 100644 index 0000000..3f07637 --- /dev/null +++ b/pio_workspace/lib/ros_lib/rtabmap_msgs/ScanDescriptor.h @@ -0,0 +1,62 @@ +#ifndef _ROS_rtabmap_msgs_ScanDescriptor_h +#define _ROS_rtabmap_msgs_ScanDescriptor_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "sensor_msgs/LaserScan.h" +#include "sensor_msgs/PointCloud2.h" +#include "rtabmap_msgs/GlobalDescriptor.h" + +namespace rtabmap_msgs +{ + + class ScanDescriptor : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef sensor_msgs::LaserScan _scan_type; + _scan_type scan; + typedef sensor_msgs::PointCloud2 _scan_cloud_type; + _scan_cloud_type scan_cloud; + typedef rtabmap_msgs::GlobalDescriptor _global_descriptor_type; + _global_descriptor_type global_descriptor; + + ScanDescriptor(): + header(), + scan(), + scan_cloud(), + global_descriptor() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->scan.serialize(outbuffer + offset); + offset += this->scan_cloud.serialize(outbuffer + offset); + offset += this->global_descriptor.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->scan.deserialize(inbuffer + offset); + offset += this->scan_cloud.deserialize(inbuffer + offset); + offset += this->global_descriptor.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "rtabmap_msgs/ScanDescriptor"; }; + virtual const char * getMD5() override { return "e76f45a9fe00fd5492368db8040ccbec"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/rtabmap_msgs/SensorData.h b/pio_workspace/lib/ros_lib/rtabmap_msgs/SensorData.h new file mode 100644 index 0000000..3b5b259 --- /dev/null +++ b/pio_workspace/lib/ros_lib/rtabmap_msgs/SensorData.h @@ -0,0 +1,613 @@ +#ifndef _ROS_rtabmap_msgs_SensorData_h +#define _ROS_rtabmap_msgs_SensorData_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "sensor_msgs/Image.h" +#include "sensor_msgs/CameraInfo.h" +#include "geometry_msgs/Transform.h" +#include "sensor_msgs/PointCloud2.h" +#include "rtabmap_msgs/Point3f.h" +#include "rtabmap_msgs/KeyPoint.h" +#include "rtabmap_msgs/GlobalDescriptor.h" +#include "rtabmap_msgs/EnvSensor.h" +#include "sensor_msgs/Imu.h" +#include "rtabmap_msgs/LandmarkDetection.h" +#include "geometry_msgs/Pose.h" +#include "rtabmap_msgs/GPS.h" + +namespace rtabmap_msgs +{ + + class SensorData : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef sensor_msgs::Image _left_type; + _left_type left; + typedef sensor_msgs::Image _right_type; + _right_type right; + uint32_t left_compressed_length; + typedef uint8_t _left_compressed_type; + _left_compressed_type st_left_compressed; + _left_compressed_type * left_compressed; + uint32_t right_compressed_length; + typedef uint8_t _right_compressed_type; + _right_compressed_type st_right_compressed; + _right_compressed_type * right_compressed; + uint32_t left_camera_info_length; + typedef sensor_msgs::CameraInfo _left_camera_info_type; + _left_camera_info_type st_left_camera_info; + _left_camera_info_type * left_camera_info; + uint32_t right_camera_info_length; + typedef sensor_msgs::CameraInfo _right_camera_info_type; + _right_camera_info_type st_right_camera_info; + _right_camera_info_type * right_camera_info; + uint32_t local_transform_length; + typedef geometry_msgs::Transform _local_transform_type; + _local_transform_type st_local_transform; + _local_transform_type * local_transform; + typedef sensor_msgs::PointCloud2 _laser_scan_type; + _laser_scan_type laser_scan; + uint32_t laser_scan_compressed_length; + typedef uint8_t _laser_scan_compressed_type; + _laser_scan_compressed_type st_laser_scan_compressed; + _laser_scan_compressed_type * laser_scan_compressed; + typedef int32_t _laser_scan_max_pts_type; + _laser_scan_max_pts_type laser_scan_max_pts; + typedef float _laser_scan_max_range_type; + _laser_scan_max_range_type laser_scan_max_range; + typedef int32_t _laser_scan_format_type; + _laser_scan_format_type laser_scan_format; + typedef geometry_msgs::Transform _laser_scan_local_transform_type; + _laser_scan_local_transform_type laser_scan_local_transform; + uint32_t user_data_length; + typedef uint8_t _user_data_type; + _user_data_type st_user_data; + _user_data_type * user_data; + uint32_t grid_ground_length; + typedef uint8_t _grid_ground_type; + _grid_ground_type st_grid_ground; + _grid_ground_type * grid_ground; + uint32_t grid_obstacles_length; + typedef uint8_t _grid_obstacles_type; + _grid_obstacles_type st_grid_obstacles; + _grid_obstacles_type * grid_obstacles; + uint32_t grid_empty_cells_length; + typedef uint8_t _grid_empty_cells_type; + _grid_empty_cells_type st_grid_empty_cells; + _grid_empty_cells_type * grid_empty_cells; + typedef float _grid_cell_size_type; + _grid_cell_size_type grid_cell_size; + typedef rtabmap_msgs::Point3f _grid_view_point_type; + _grid_view_point_type grid_view_point; + uint32_t key_points_length; + typedef rtabmap_msgs::KeyPoint _key_points_type; + _key_points_type st_key_points; + _key_points_type * key_points; + uint32_t points_length; + typedef rtabmap_msgs::Point3f _points_type; + _points_type st_points; + _points_type * points; + uint32_t descriptors_length; + typedef uint8_t _descriptors_type; + _descriptors_type st_descriptors; + _descriptors_type * descriptors; + uint32_t global_descriptors_length; + typedef rtabmap_msgs::GlobalDescriptor _global_descriptors_type; + _global_descriptors_type st_global_descriptors; + _global_descriptors_type * global_descriptors; + uint32_t env_sensors_length; + typedef rtabmap_msgs::EnvSensor _env_sensors_type; + _env_sensors_type st_env_sensors; + _env_sensors_type * env_sensors; + typedef sensor_msgs::Imu _imu_type; + _imu_type imu; + typedef geometry_msgs::Transform _imu_local_transform_type; + _imu_local_transform_type imu_local_transform; + uint32_t landmarks_length; + typedef rtabmap_msgs::LandmarkDetection _landmarks_type; + _landmarks_type st_landmarks; + _landmarks_type * landmarks; + typedef geometry_msgs::Pose _ground_truth_pose_type; + _ground_truth_pose_type ground_truth_pose; + typedef rtabmap_msgs::GPS _gps_type; + _gps_type gps; + + SensorData(): + header(), + left(), + right(), + left_compressed_length(0), st_left_compressed(), left_compressed(nullptr), + right_compressed_length(0), st_right_compressed(), right_compressed(nullptr), + left_camera_info_length(0), st_left_camera_info(), left_camera_info(nullptr), + right_camera_info_length(0), st_right_camera_info(), right_camera_info(nullptr), + local_transform_length(0), st_local_transform(), local_transform(nullptr), + laser_scan(), + laser_scan_compressed_length(0), st_laser_scan_compressed(), laser_scan_compressed(nullptr), + laser_scan_max_pts(0), + laser_scan_max_range(0), + laser_scan_format(0), + laser_scan_local_transform(), + user_data_length(0), st_user_data(), user_data(nullptr), + grid_ground_length(0), st_grid_ground(), grid_ground(nullptr), + grid_obstacles_length(0), st_grid_obstacles(), grid_obstacles(nullptr), + grid_empty_cells_length(0), st_grid_empty_cells(), grid_empty_cells(nullptr), + grid_cell_size(0), + grid_view_point(), + key_points_length(0), st_key_points(), key_points(nullptr), + points_length(0), st_points(), points(nullptr), + descriptors_length(0), st_descriptors(), descriptors(nullptr), + global_descriptors_length(0), st_global_descriptors(), global_descriptors(nullptr), + env_sensors_length(0), st_env_sensors(), env_sensors(nullptr), + imu(), + imu_local_transform(), + landmarks_length(0), st_landmarks(), landmarks(nullptr), + ground_truth_pose(), + gps() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->left.serialize(outbuffer + offset); + offset += this->right.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->left_compressed_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->left_compressed_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->left_compressed_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->left_compressed_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->left_compressed_length); + for( uint32_t i = 0; i < left_compressed_length; i++){ + *(outbuffer + offset + 0) = (this->left_compressed[i] >> (8 * 0)) & 0xFF; + offset += sizeof(this->left_compressed[i]); + } + *(outbuffer + offset + 0) = (this->right_compressed_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->right_compressed_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->right_compressed_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->right_compressed_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->right_compressed_length); + for( uint32_t i = 0; i < right_compressed_length; i++){ + *(outbuffer + offset + 0) = (this->right_compressed[i] >> (8 * 0)) & 0xFF; + offset += sizeof(this->right_compressed[i]); + } + *(outbuffer + offset + 0) = (this->left_camera_info_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->left_camera_info_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->left_camera_info_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->left_camera_info_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->left_camera_info_length); + for( uint32_t i = 0; i < left_camera_info_length; i++){ + offset += this->left_camera_info[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->right_camera_info_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->right_camera_info_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->right_camera_info_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->right_camera_info_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->right_camera_info_length); + for( uint32_t i = 0; i < right_camera_info_length; i++){ + offset += this->right_camera_info[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->local_transform_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->local_transform_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->local_transform_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->local_transform_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->local_transform_length); + for( uint32_t i = 0; i < local_transform_length; i++){ + offset += this->local_transform[i].serialize(outbuffer + offset); + } + offset += this->laser_scan.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->laser_scan_compressed_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->laser_scan_compressed_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->laser_scan_compressed_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->laser_scan_compressed_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->laser_scan_compressed_length); + for( uint32_t i = 0; i < laser_scan_compressed_length; i++){ + *(outbuffer + offset + 0) = (this->laser_scan_compressed[i] >> (8 * 0)) & 0xFF; + offset += sizeof(this->laser_scan_compressed[i]); + } + union { + int32_t real; + uint32_t base; + } u_laser_scan_max_pts; + u_laser_scan_max_pts.real = this->laser_scan_max_pts; + *(outbuffer + offset + 0) = (u_laser_scan_max_pts.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_laser_scan_max_pts.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_laser_scan_max_pts.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_laser_scan_max_pts.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->laser_scan_max_pts); + union { + float real; + uint32_t base; + } u_laser_scan_max_range; + u_laser_scan_max_range.real = this->laser_scan_max_range; + *(outbuffer + offset + 0) = (u_laser_scan_max_range.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_laser_scan_max_range.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_laser_scan_max_range.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_laser_scan_max_range.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->laser_scan_max_range); + union { + int32_t real; + uint32_t base; + } u_laser_scan_format; + u_laser_scan_format.real = this->laser_scan_format; + *(outbuffer + offset + 0) = (u_laser_scan_format.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_laser_scan_format.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_laser_scan_format.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_laser_scan_format.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->laser_scan_format); + offset += this->laser_scan_local_transform.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->user_data_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->user_data_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->user_data_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->user_data_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->user_data_length); + for( uint32_t i = 0; i < user_data_length; i++){ + *(outbuffer + offset + 0) = (this->user_data[i] >> (8 * 0)) & 0xFF; + offset += sizeof(this->user_data[i]); + } + *(outbuffer + offset + 0) = (this->grid_ground_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->grid_ground_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->grid_ground_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->grid_ground_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->grid_ground_length); + for( uint32_t i = 0; i < grid_ground_length; i++){ + *(outbuffer + offset + 0) = (this->grid_ground[i] >> (8 * 0)) & 0xFF; + offset += sizeof(this->grid_ground[i]); + } + *(outbuffer + offset + 0) = (this->grid_obstacles_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->grid_obstacles_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->grid_obstacles_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->grid_obstacles_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->grid_obstacles_length); + for( uint32_t i = 0; i < grid_obstacles_length; i++){ + *(outbuffer + offset + 0) = (this->grid_obstacles[i] >> (8 * 0)) & 0xFF; + offset += sizeof(this->grid_obstacles[i]); + } + *(outbuffer + offset + 0) = (this->grid_empty_cells_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->grid_empty_cells_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->grid_empty_cells_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->grid_empty_cells_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->grid_empty_cells_length); + for( uint32_t i = 0; i < grid_empty_cells_length; i++){ + *(outbuffer + offset + 0) = (this->grid_empty_cells[i] >> (8 * 0)) & 0xFF; + offset += sizeof(this->grid_empty_cells[i]); + } + union { + float real; + uint32_t base; + } u_grid_cell_size; + u_grid_cell_size.real = this->grid_cell_size; + *(outbuffer + offset + 0) = (u_grid_cell_size.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_grid_cell_size.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_grid_cell_size.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_grid_cell_size.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->grid_cell_size); + offset += this->grid_view_point.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->key_points_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->key_points_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->key_points_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->key_points_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->key_points_length); + for( uint32_t i = 0; i < key_points_length; i++){ + offset += this->key_points[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->points_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->points_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->points_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->points_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->points_length); + for( uint32_t i = 0; i < points_length; i++){ + offset += this->points[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->descriptors_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->descriptors_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->descriptors_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->descriptors_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->descriptors_length); + for( uint32_t i = 0; i < descriptors_length; i++){ + *(outbuffer + offset + 0) = (this->descriptors[i] >> (8 * 0)) & 0xFF; + offset += sizeof(this->descriptors[i]); + } + *(outbuffer + offset + 0) = (this->global_descriptors_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->global_descriptors_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->global_descriptors_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->global_descriptors_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->global_descriptors_length); + for( uint32_t i = 0; i < global_descriptors_length; i++){ + offset += this->global_descriptors[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->env_sensors_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->env_sensors_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->env_sensors_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->env_sensors_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->env_sensors_length); + for( uint32_t i = 0; i < env_sensors_length; i++){ + offset += this->env_sensors[i].serialize(outbuffer + offset); + } + offset += this->imu.serialize(outbuffer + offset); + offset += this->imu_local_transform.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->landmarks_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->landmarks_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->landmarks_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->landmarks_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->landmarks_length); + for( uint32_t i = 0; i < landmarks_length; i++){ + offset += this->landmarks[i].serialize(outbuffer + offset); + } + offset += this->ground_truth_pose.serialize(outbuffer + offset); + offset += this->gps.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->left.deserialize(inbuffer + offset); + offset += this->right.deserialize(inbuffer + offset); + uint32_t left_compressed_lengthT = ((uint32_t) (*(inbuffer + offset))); + left_compressed_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + left_compressed_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + left_compressed_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->left_compressed_length); + if(left_compressed_lengthT > left_compressed_length) + this->left_compressed = (uint8_t*)realloc(this->left_compressed, left_compressed_lengthT * sizeof(uint8_t)); + left_compressed_length = left_compressed_lengthT; + for( uint32_t i = 0; i < left_compressed_length; i++){ + this->st_left_compressed = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->st_left_compressed); + memcpy( &(this->left_compressed[i]), &(this->st_left_compressed), sizeof(uint8_t)); + } + uint32_t right_compressed_lengthT = ((uint32_t) (*(inbuffer + offset))); + right_compressed_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + right_compressed_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + right_compressed_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->right_compressed_length); + if(right_compressed_lengthT > right_compressed_length) + this->right_compressed = (uint8_t*)realloc(this->right_compressed, right_compressed_lengthT * sizeof(uint8_t)); + right_compressed_length = right_compressed_lengthT; + for( uint32_t i = 0; i < right_compressed_length; i++){ + this->st_right_compressed = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->st_right_compressed); + memcpy( &(this->right_compressed[i]), &(this->st_right_compressed), sizeof(uint8_t)); + } + uint32_t left_camera_info_lengthT = ((uint32_t) (*(inbuffer + offset))); + left_camera_info_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + left_camera_info_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + left_camera_info_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->left_camera_info_length); + if(left_camera_info_lengthT > left_camera_info_length) + this->left_camera_info = (sensor_msgs::CameraInfo*)realloc(this->left_camera_info, left_camera_info_lengthT * sizeof(sensor_msgs::CameraInfo)); + left_camera_info_length = left_camera_info_lengthT; + for( uint32_t i = 0; i < left_camera_info_length; i++){ + offset += this->st_left_camera_info.deserialize(inbuffer + offset); + memcpy( &(this->left_camera_info[i]), &(this->st_left_camera_info), sizeof(sensor_msgs::CameraInfo)); + } + uint32_t right_camera_info_lengthT = ((uint32_t) (*(inbuffer + offset))); + right_camera_info_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + right_camera_info_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + right_camera_info_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->right_camera_info_length); + if(right_camera_info_lengthT > right_camera_info_length) + this->right_camera_info = (sensor_msgs::CameraInfo*)realloc(this->right_camera_info, right_camera_info_lengthT * sizeof(sensor_msgs::CameraInfo)); + right_camera_info_length = right_camera_info_lengthT; + for( uint32_t i = 0; i < right_camera_info_length; i++){ + offset += this->st_right_camera_info.deserialize(inbuffer + offset); + memcpy( &(this->right_camera_info[i]), &(this->st_right_camera_info), sizeof(sensor_msgs::CameraInfo)); + } + uint32_t local_transform_lengthT = ((uint32_t) (*(inbuffer + offset))); + local_transform_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + local_transform_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + local_transform_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->local_transform_length); + if(local_transform_lengthT > local_transform_length) + this->local_transform = (geometry_msgs::Transform*)realloc(this->local_transform, local_transform_lengthT * sizeof(geometry_msgs::Transform)); + local_transform_length = local_transform_lengthT; + for( uint32_t i = 0; i < local_transform_length; i++){ + offset += this->st_local_transform.deserialize(inbuffer + offset); + memcpy( &(this->local_transform[i]), &(this->st_local_transform), sizeof(geometry_msgs::Transform)); + } + offset += this->laser_scan.deserialize(inbuffer + offset); + uint32_t laser_scan_compressed_lengthT = ((uint32_t) (*(inbuffer + offset))); + laser_scan_compressed_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + laser_scan_compressed_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + laser_scan_compressed_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->laser_scan_compressed_length); + if(laser_scan_compressed_lengthT > laser_scan_compressed_length) + this->laser_scan_compressed = (uint8_t*)realloc(this->laser_scan_compressed, laser_scan_compressed_lengthT * sizeof(uint8_t)); + laser_scan_compressed_length = laser_scan_compressed_lengthT; + for( uint32_t i = 0; i < laser_scan_compressed_length; i++){ + this->st_laser_scan_compressed = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->st_laser_scan_compressed); + memcpy( &(this->laser_scan_compressed[i]), &(this->st_laser_scan_compressed), sizeof(uint8_t)); + } + union { + int32_t real; + uint32_t base; + } u_laser_scan_max_pts; + u_laser_scan_max_pts.base = 0; + u_laser_scan_max_pts.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_laser_scan_max_pts.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_laser_scan_max_pts.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_laser_scan_max_pts.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->laser_scan_max_pts = u_laser_scan_max_pts.real; + offset += sizeof(this->laser_scan_max_pts); + union { + float real; + uint32_t base; + } u_laser_scan_max_range; + u_laser_scan_max_range.base = 0; + u_laser_scan_max_range.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_laser_scan_max_range.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_laser_scan_max_range.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_laser_scan_max_range.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->laser_scan_max_range = u_laser_scan_max_range.real; + offset += sizeof(this->laser_scan_max_range); + union { + int32_t real; + uint32_t base; + } u_laser_scan_format; + u_laser_scan_format.base = 0; + u_laser_scan_format.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_laser_scan_format.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_laser_scan_format.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_laser_scan_format.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->laser_scan_format = u_laser_scan_format.real; + offset += sizeof(this->laser_scan_format); + offset += this->laser_scan_local_transform.deserialize(inbuffer + offset); + uint32_t user_data_lengthT = ((uint32_t) (*(inbuffer + offset))); + user_data_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + user_data_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + user_data_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->user_data_length); + if(user_data_lengthT > user_data_length) + this->user_data = (uint8_t*)realloc(this->user_data, user_data_lengthT * sizeof(uint8_t)); + user_data_length = user_data_lengthT; + for( uint32_t i = 0; i < user_data_length; i++){ + this->st_user_data = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->st_user_data); + memcpy( &(this->user_data[i]), &(this->st_user_data), sizeof(uint8_t)); + } + uint32_t grid_ground_lengthT = ((uint32_t) (*(inbuffer + offset))); + grid_ground_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + grid_ground_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + grid_ground_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->grid_ground_length); + if(grid_ground_lengthT > grid_ground_length) + this->grid_ground = (uint8_t*)realloc(this->grid_ground, grid_ground_lengthT * sizeof(uint8_t)); + grid_ground_length = grid_ground_lengthT; + for( uint32_t i = 0; i < grid_ground_length; i++){ + this->st_grid_ground = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->st_grid_ground); + memcpy( &(this->grid_ground[i]), &(this->st_grid_ground), sizeof(uint8_t)); + } + uint32_t grid_obstacles_lengthT = ((uint32_t) (*(inbuffer + offset))); + grid_obstacles_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + grid_obstacles_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + grid_obstacles_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->grid_obstacles_length); + if(grid_obstacles_lengthT > grid_obstacles_length) + this->grid_obstacles = (uint8_t*)realloc(this->grid_obstacles, grid_obstacles_lengthT * sizeof(uint8_t)); + grid_obstacles_length = grid_obstacles_lengthT; + for( uint32_t i = 0; i < grid_obstacles_length; i++){ + this->st_grid_obstacles = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->st_grid_obstacles); + memcpy( &(this->grid_obstacles[i]), &(this->st_grid_obstacles), sizeof(uint8_t)); + } + uint32_t grid_empty_cells_lengthT = ((uint32_t) (*(inbuffer + offset))); + grid_empty_cells_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + grid_empty_cells_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + grid_empty_cells_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->grid_empty_cells_length); + if(grid_empty_cells_lengthT > grid_empty_cells_length) + this->grid_empty_cells = (uint8_t*)realloc(this->grid_empty_cells, grid_empty_cells_lengthT * sizeof(uint8_t)); + grid_empty_cells_length = grid_empty_cells_lengthT; + for( uint32_t i = 0; i < grid_empty_cells_length; i++){ + this->st_grid_empty_cells = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->st_grid_empty_cells); + memcpy( &(this->grid_empty_cells[i]), &(this->st_grid_empty_cells), sizeof(uint8_t)); + } + union { + float real; + uint32_t base; + } u_grid_cell_size; + u_grid_cell_size.base = 0; + u_grid_cell_size.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_grid_cell_size.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_grid_cell_size.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_grid_cell_size.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->grid_cell_size = u_grid_cell_size.real; + offset += sizeof(this->grid_cell_size); + offset += this->grid_view_point.deserialize(inbuffer + offset); + uint32_t key_points_lengthT = ((uint32_t) (*(inbuffer + offset))); + key_points_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + key_points_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + key_points_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->key_points_length); + if(key_points_lengthT > key_points_length) + this->key_points = (rtabmap_msgs::KeyPoint*)realloc(this->key_points, key_points_lengthT * sizeof(rtabmap_msgs::KeyPoint)); + key_points_length = key_points_lengthT; + for( uint32_t i = 0; i < key_points_length; i++){ + offset += this->st_key_points.deserialize(inbuffer + offset); + memcpy( &(this->key_points[i]), &(this->st_key_points), sizeof(rtabmap_msgs::KeyPoint)); + } + uint32_t points_lengthT = ((uint32_t) (*(inbuffer + offset))); + points_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + points_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + points_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->points_length); + if(points_lengthT > points_length) + this->points = (rtabmap_msgs::Point3f*)realloc(this->points, points_lengthT * sizeof(rtabmap_msgs::Point3f)); + points_length = points_lengthT; + for( uint32_t i = 0; i < points_length; i++){ + offset += this->st_points.deserialize(inbuffer + offset); + memcpy( &(this->points[i]), &(this->st_points), sizeof(rtabmap_msgs::Point3f)); + } + uint32_t descriptors_lengthT = ((uint32_t) (*(inbuffer + offset))); + descriptors_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + descriptors_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + descriptors_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->descriptors_length); + if(descriptors_lengthT > descriptors_length) + this->descriptors = (uint8_t*)realloc(this->descriptors, descriptors_lengthT * sizeof(uint8_t)); + descriptors_length = descriptors_lengthT; + for( uint32_t i = 0; i < descriptors_length; i++){ + this->st_descriptors = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->st_descriptors); + memcpy( &(this->descriptors[i]), &(this->st_descriptors), sizeof(uint8_t)); + } + uint32_t global_descriptors_lengthT = ((uint32_t) (*(inbuffer + offset))); + global_descriptors_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + global_descriptors_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + global_descriptors_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->global_descriptors_length); + if(global_descriptors_lengthT > global_descriptors_length) + this->global_descriptors = (rtabmap_msgs::GlobalDescriptor*)realloc(this->global_descriptors, global_descriptors_lengthT * sizeof(rtabmap_msgs::GlobalDescriptor)); + global_descriptors_length = global_descriptors_lengthT; + for( uint32_t i = 0; i < global_descriptors_length; i++){ + offset += this->st_global_descriptors.deserialize(inbuffer + offset); + memcpy( &(this->global_descriptors[i]), &(this->st_global_descriptors), sizeof(rtabmap_msgs::GlobalDescriptor)); + } + uint32_t env_sensors_lengthT = ((uint32_t) (*(inbuffer + offset))); + env_sensors_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + env_sensors_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + env_sensors_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->env_sensors_length); + if(env_sensors_lengthT > env_sensors_length) + this->env_sensors = (rtabmap_msgs::EnvSensor*)realloc(this->env_sensors, env_sensors_lengthT * sizeof(rtabmap_msgs::EnvSensor)); + env_sensors_length = env_sensors_lengthT; + for( uint32_t i = 0; i < env_sensors_length; i++){ + offset += this->st_env_sensors.deserialize(inbuffer + offset); + memcpy( &(this->env_sensors[i]), &(this->st_env_sensors), sizeof(rtabmap_msgs::EnvSensor)); + } + offset += this->imu.deserialize(inbuffer + offset); + offset += this->imu_local_transform.deserialize(inbuffer + offset); + uint32_t landmarks_lengthT = ((uint32_t) (*(inbuffer + offset))); + landmarks_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + landmarks_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + landmarks_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->landmarks_length); + if(landmarks_lengthT > landmarks_length) + this->landmarks = (rtabmap_msgs::LandmarkDetection*)realloc(this->landmarks, landmarks_lengthT * sizeof(rtabmap_msgs::LandmarkDetection)); + landmarks_length = landmarks_lengthT; + for( uint32_t i = 0; i < landmarks_length; i++){ + offset += this->st_landmarks.deserialize(inbuffer + offset); + memcpy( &(this->landmarks[i]), &(this->st_landmarks), sizeof(rtabmap_msgs::LandmarkDetection)); + } + offset += this->ground_truth_pose.deserialize(inbuffer + offset); + offset += this->gps.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "rtabmap_msgs/SensorData"; }; + virtual const char * getMD5() override { return "1408cf03fa94547ee9b7bdda6d8918c2"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/rtabmap_msgs/SetGoal.h b/pio_workspace/lib/ros_lib/rtabmap_msgs/SetGoal.h new file mode 100644 index 0000000..a17a0d8 --- /dev/null +++ b/pio_workspace/lib/ros_lib/rtabmap_msgs/SetGoal.h @@ -0,0 +1,222 @@ +#ifndef _ROS_SERVICE_SetGoal_h +#define _ROS_SERVICE_SetGoal_h +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Pose.h" + +namespace rtabmap_msgs +{ + +static const char SETGOAL[] = "rtabmap_msgs/SetGoal"; + + class SetGoalRequest : public ros::Msg + { + public: + typedef int32_t _node_id_type; + _node_id_type node_id; + typedef const char* _node_label_type; + _node_label_type node_label; + typedef const char* _frame_id_type; + _frame_id_type frame_id; + + SetGoalRequest(): + node_id(0), + node_label(""), + frame_id("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_node_id; + u_node_id.real = this->node_id; + *(outbuffer + offset + 0) = (u_node_id.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_node_id.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_node_id.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_node_id.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->node_id); + uint32_t length_node_label = strlen(this->node_label); + varToArr(outbuffer + offset, length_node_label); + offset += 4; + memcpy(outbuffer + offset, this->node_label, length_node_label); + offset += length_node_label; + uint32_t length_frame_id = strlen(this->frame_id); + varToArr(outbuffer + offset, length_frame_id); + offset += 4; + memcpy(outbuffer + offset, this->frame_id, length_frame_id); + offset += length_frame_id; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_node_id; + u_node_id.base = 0; + u_node_id.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_node_id.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_node_id.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_node_id.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->node_id = u_node_id.real; + offset += sizeof(this->node_id); + uint32_t length_node_label; + arrToVar(length_node_label, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_node_label; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_node_label-1]=0; + this->node_label = (char *)(inbuffer + offset-1); + offset += length_node_label; + uint32_t length_frame_id; + arrToVar(length_frame_id, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_frame_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_frame_id-1]=0; + this->frame_id = (char *)(inbuffer + offset-1); + offset += length_frame_id; + return offset; + } + + virtual const char * getType() override { return SETGOAL; }; + virtual const char * getMD5() override { return "375ab24253ceefb71e0472c1b972fff4"; }; + + }; + + class SetGoalResponse : public ros::Msg + { + public: + uint32_t path_ids_length; + typedef int32_t _path_ids_type; + _path_ids_type st_path_ids; + _path_ids_type * path_ids; + uint32_t path_poses_length; + typedef geometry_msgs::Pose _path_poses_type; + _path_poses_type st_path_poses; + _path_poses_type * path_poses; + typedef float _planning_time_type; + _planning_time_type planning_time; + + SetGoalResponse(): + path_ids_length(0), st_path_ids(), path_ids(nullptr), + path_poses_length(0), st_path_poses(), path_poses(nullptr), + planning_time(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->path_ids_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->path_ids_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->path_ids_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->path_ids_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->path_ids_length); + for( uint32_t i = 0; i < path_ids_length; i++){ + union { + int32_t real; + uint32_t base; + } u_path_idsi; + u_path_idsi.real = this->path_ids[i]; + *(outbuffer + offset + 0) = (u_path_idsi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_path_idsi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_path_idsi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_path_idsi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->path_ids[i]); + } + *(outbuffer + offset + 0) = (this->path_poses_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->path_poses_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->path_poses_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->path_poses_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->path_poses_length); + for( uint32_t i = 0; i < path_poses_length; i++){ + offset += this->path_poses[i].serialize(outbuffer + offset); + } + union { + float real; + uint32_t base; + } u_planning_time; + u_planning_time.real = this->planning_time; + *(outbuffer + offset + 0) = (u_planning_time.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_planning_time.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_planning_time.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_planning_time.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->planning_time); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t path_ids_lengthT = ((uint32_t) (*(inbuffer + offset))); + path_ids_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + path_ids_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + path_ids_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->path_ids_length); + if(path_ids_lengthT > path_ids_length) + this->path_ids = (int32_t*)realloc(this->path_ids, path_ids_lengthT * sizeof(int32_t)); + path_ids_length = path_ids_lengthT; + for( uint32_t i = 0; i < path_ids_length; i++){ + union { + int32_t real; + uint32_t base; + } u_st_path_ids; + u_st_path_ids.base = 0; + u_st_path_ids.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_path_ids.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_path_ids.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_path_ids.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_path_ids = u_st_path_ids.real; + offset += sizeof(this->st_path_ids); + memcpy( &(this->path_ids[i]), &(this->st_path_ids), sizeof(int32_t)); + } + uint32_t path_poses_lengthT = ((uint32_t) (*(inbuffer + offset))); + path_poses_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + path_poses_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + path_poses_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->path_poses_length); + if(path_poses_lengthT > path_poses_length) + this->path_poses = (geometry_msgs::Pose*)realloc(this->path_poses, path_poses_lengthT * sizeof(geometry_msgs::Pose)); + path_poses_length = path_poses_lengthT; + for( uint32_t i = 0; i < path_poses_length; i++){ + offset += this->st_path_poses.deserialize(inbuffer + offset); + memcpy( &(this->path_poses[i]), &(this->st_path_poses), sizeof(geometry_msgs::Pose)); + } + union { + float real; + uint32_t base; + } u_planning_time; + u_planning_time.base = 0; + u_planning_time.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_planning_time.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_planning_time.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_planning_time.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->planning_time = u_planning_time.real; + offset += sizeof(this->planning_time); + return offset; + } + + virtual const char * getType() override { return SETGOAL; }; + virtual const char * getMD5() override { return "adca6a85ab21f03d516676b74309de28"; }; + + }; + + class SetGoal { + public: + typedef SetGoalRequest Request; + typedef SetGoalResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/rtabmap_msgs/SetLabel.h b/pio_workspace/lib/ros_lib/rtabmap_msgs/SetLabel.h new file mode 100644 index 0000000..af66718 --- /dev/null +++ b/pio_workspace/lib/ros_lib/rtabmap_msgs/SetLabel.h @@ -0,0 +1,111 @@ +#ifndef _ROS_SERVICE_SetLabel_h +#define _ROS_SERVICE_SetLabel_h +#include +#include +#include +#include "ros/msg.h" + +namespace rtabmap_msgs +{ + +static const char SETLABEL[] = "rtabmap_msgs/SetLabel"; + + class SetLabelRequest : public ros::Msg + { + public: + typedef int32_t _node_id_type; + _node_id_type node_id; + typedef const char* _node_label_type; + _node_label_type node_label; + + SetLabelRequest(): + node_id(0), + node_label("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_node_id; + u_node_id.real = this->node_id; + *(outbuffer + offset + 0) = (u_node_id.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_node_id.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_node_id.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_node_id.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->node_id); + uint32_t length_node_label = strlen(this->node_label); + varToArr(outbuffer + offset, length_node_label); + offset += 4; + memcpy(outbuffer + offset, this->node_label, length_node_label); + offset += length_node_label; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_node_id; + u_node_id.base = 0; + u_node_id.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_node_id.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_node_id.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_node_id.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->node_id = u_node_id.real; + offset += sizeof(this->node_id); + uint32_t length_node_label; + arrToVar(length_node_label, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_node_label; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_node_label-1]=0; + this->node_label = (char *)(inbuffer + offset-1); + offset += length_node_label; + return offset; + } + + virtual const char * getType() override { return SETLABEL; }; + virtual const char * getMD5() override { return "baadfb04a43ec26085eb7bebc9a80862"; }; + + }; + + class SetLabelResponse : public ros::Msg + { + public: + + SetLabelResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + return offset; + } + + virtual const char * getType() override { return SETLABEL; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class SetLabel { + public: + typedef SetLabelRequest Request; + typedef SetLabelResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/rtabmap_msgs/UserData.h b/pio_workspace/lib/ros_lib/rtabmap_msgs/UserData.h new file mode 100644 index 0000000..6ee87c5 --- /dev/null +++ b/pio_workspace/lib/ros_lib/rtabmap_msgs/UserData.h @@ -0,0 +1,110 @@ +#ifndef _ROS_rtabmap_msgs_UserData_h +#define _ROS_rtabmap_msgs_UserData_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace rtabmap_msgs +{ + + class UserData : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef uint32_t _rows_type; + _rows_type rows; + typedef uint32_t _cols_type; + _cols_type cols; + typedef uint32_t _type_type; + _type_type type; + uint32_t data_length; + typedef uint8_t _data_type; + _data_type st_data; + _data_type * data; + + UserData(): + header(), + rows(0), + cols(0), + type(0), + data_length(0), st_data(), data(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->rows >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->rows >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->rows >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->rows >> (8 * 3)) & 0xFF; + offset += sizeof(this->rows); + *(outbuffer + offset + 0) = (this->cols >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->cols >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->cols >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->cols >> (8 * 3)) & 0xFF; + offset += sizeof(this->cols); + *(outbuffer + offset + 0) = (this->type >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->type >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->type >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->type >> (8 * 3)) & 0xFF; + offset += sizeof(this->type); + *(outbuffer + offset + 0) = (this->data_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->data_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->data_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->data_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->data_length); + for( uint32_t i = 0; i < data_length; i++){ + *(outbuffer + offset + 0) = (this->data[i] >> (8 * 0)) & 0xFF; + offset += sizeof(this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + this->rows = ((uint32_t) (*(inbuffer + offset))); + this->rows |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->rows |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->rows |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->rows); + this->cols = ((uint32_t) (*(inbuffer + offset))); + this->cols |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->cols |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->cols |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->cols); + this->type = ((uint32_t) (*(inbuffer + offset))); + this->type |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->type |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->type |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->type); + uint32_t data_lengthT = ((uint32_t) (*(inbuffer + offset))); + data_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + data_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + data_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->data_length); + if(data_lengthT > data_length) + this->data = (uint8_t*)realloc(this->data, data_lengthT * sizeof(uint8_t)); + data_length = data_lengthT; + for( uint32_t i = 0; i < data_length; i++){ + this->st_data = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(uint8_t)); + } + return offset; + } + + virtual const char * getType() override { return "rtabmap_msgs/UserData"; }; + virtual const char * getMD5() override { return "e2b3ca3c96ccd4baa19ca1aeef9ec767"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/theora_image_transport/Packet.h b/pio_workspace/lib/ros_lib/theora_image_transport/Packet.h deleted file mode 100644 index f4a16f6..0000000 --- a/pio_workspace/lib/ros_lib/theora_image_transport/Packet.h +++ /dev/null @@ -1,183 +0,0 @@ -#ifndef _ROS_theora_image_transport_Packet_h -#define _ROS_theora_image_transport_Packet_h - -#include -#include -#include -#include "ros/msg.h" -#include "std_msgs/Header.h" - -namespace theora_image_transport -{ - - class Packet : public ros::Msg - { - public: - typedef std_msgs::Header _header_type; - _header_type header; - uint32_t data_length; - typedef uint8_t _data_type; - _data_type st_data; - _data_type * data; - typedef int32_t _b_o_s_type; - _b_o_s_type b_o_s; - typedef int32_t _e_o_s_type; - _e_o_s_type e_o_s; - typedef int64_t _granulepos_type; - _granulepos_type granulepos; - typedef int64_t _packetno_type; - _packetno_type packetno; - - Packet(): - header(), - data_length(0), st_data(), data(nullptr), - b_o_s(0), - e_o_s(0), - granulepos(0), - packetno(0) - { - } - - virtual int serialize(unsigned char *outbuffer) const override - { - int offset = 0; - offset += this->header.serialize(outbuffer + offset); - *(outbuffer + offset + 0) = (this->data_length >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (this->data_length >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (this->data_length >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (this->data_length >> (8 * 3)) & 0xFF; - offset += sizeof(this->data_length); - for( uint32_t i = 0; i < data_length; i++){ - *(outbuffer + offset + 0) = (this->data[i] >> (8 * 0)) & 0xFF; - offset += sizeof(this->data[i]); - } - union { - int32_t real; - uint32_t base; - } u_b_o_s; - u_b_o_s.real = this->b_o_s; - *(outbuffer + offset + 0) = (u_b_o_s.base >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (u_b_o_s.base >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (u_b_o_s.base >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (u_b_o_s.base >> (8 * 3)) & 0xFF; - offset += sizeof(this->b_o_s); - union { - int32_t real; - uint32_t base; - } u_e_o_s; - u_e_o_s.real = this->e_o_s; - *(outbuffer + offset + 0) = (u_e_o_s.base >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (u_e_o_s.base >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (u_e_o_s.base >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (u_e_o_s.base >> (8 * 3)) & 0xFF; - offset += sizeof(this->e_o_s); - union { - int64_t real; - uint64_t base; - } u_granulepos; - u_granulepos.real = this->granulepos; - *(outbuffer + offset + 0) = (u_granulepos.base >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (u_granulepos.base >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (u_granulepos.base >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (u_granulepos.base >> (8 * 3)) & 0xFF; - *(outbuffer + offset + 4) = (u_granulepos.base >> (8 * 4)) & 0xFF; - *(outbuffer + offset + 5) = (u_granulepos.base >> (8 * 5)) & 0xFF; - *(outbuffer + offset + 6) = (u_granulepos.base >> (8 * 6)) & 0xFF; - *(outbuffer + offset + 7) = (u_granulepos.base >> (8 * 7)) & 0xFF; - offset += sizeof(this->granulepos); - union { - int64_t real; - uint64_t base; - } u_packetno; - u_packetno.real = this->packetno; - *(outbuffer + offset + 0) = (u_packetno.base >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (u_packetno.base >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (u_packetno.base >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (u_packetno.base >> (8 * 3)) & 0xFF; - *(outbuffer + offset + 4) = (u_packetno.base >> (8 * 4)) & 0xFF; - *(outbuffer + offset + 5) = (u_packetno.base >> (8 * 5)) & 0xFF; - *(outbuffer + offset + 6) = (u_packetno.base >> (8 * 6)) & 0xFF; - *(outbuffer + offset + 7) = (u_packetno.base >> (8 * 7)) & 0xFF; - offset += sizeof(this->packetno); - return offset; - } - - virtual int deserialize(unsigned char *inbuffer) override - { - int offset = 0; - offset += this->header.deserialize(inbuffer + offset); - uint32_t data_lengthT = ((uint32_t) (*(inbuffer + offset))); - data_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - data_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - data_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - offset += sizeof(this->data_length); - if(data_lengthT > data_length) - this->data = (uint8_t*)realloc(this->data, data_lengthT * sizeof(uint8_t)); - data_length = data_lengthT; - for( uint32_t i = 0; i < data_length; i++){ - this->st_data = ((uint8_t) (*(inbuffer + offset))); - offset += sizeof(this->st_data); - memcpy( &(this->data[i]), &(this->st_data), sizeof(uint8_t)); - } - union { - int32_t real; - uint32_t base; - } u_b_o_s; - u_b_o_s.base = 0; - u_b_o_s.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); - u_b_o_s.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - u_b_o_s.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - u_b_o_s.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - this->b_o_s = u_b_o_s.real; - offset += sizeof(this->b_o_s); - union { - int32_t real; - uint32_t base; - } u_e_o_s; - u_e_o_s.base = 0; - u_e_o_s.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); - u_e_o_s.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - u_e_o_s.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - u_e_o_s.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - this->e_o_s = u_e_o_s.real; - offset += sizeof(this->e_o_s); - union { - int64_t real; - uint64_t base; - } u_granulepos; - u_granulepos.base = 0; - u_granulepos.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); - u_granulepos.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); - u_granulepos.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); - u_granulepos.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); - u_granulepos.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); - u_granulepos.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); - u_granulepos.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); - u_granulepos.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); - this->granulepos = u_granulepos.real; - offset += sizeof(this->granulepos); - union { - int64_t real; - uint64_t base; - } u_packetno; - u_packetno.base = 0; - u_packetno.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); - u_packetno.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); - u_packetno.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); - u_packetno.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); - u_packetno.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); - u_packetno.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); - u_packetno.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); - u_packetno.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); - this->packetno = u_packetno.real; - offset += sizeof(this->packetno); - return offset; - } - - virtual const char * getType() override { return "theora_image_transport/Packet"; }; - virtual const char * getMD5() override { return "33ac4e14a7cff32e7e0d65f18bb410f3"; }; - - }; - -} -#endif diff --git a/pio_workspace/lib/ros_lib/turtle_actionlib/ShapeGoal.h b/pio_workspace/lib/ros_lib/turtle_actionlib/ShapeGoal.h deleted file mode 100644 index b40fd68..0000000 --- a/pio_workspace/lib/ros_lib/turtle_actionlib/ShapeGoal.h +++ /dev/null @@ -1,86 +0,0 @@ -#ifndef _ROS_turtle_actionlib_ShapeGoal_h -#define _ROS_turtle_actionlib_ShapeGoal_h - -#include -#include -#include -#include "ros/msg.h" - -namespace turtle_actionlib -{ - - class ShapeGoal : public ros::Msg - { - public: - typedef int32_t _edges_type; - _edges_type edges; - typedef float _radius_type; - _radius_type radius; - - ShapeGoal(): - edges(0), - radius(0) - { - } - - virtual int serialize(unsigned char *outbuffer) const override - { - int offset = 0; - union { - int32_t real; - uint32_t base; - } u_edges; - u_edges.real = this->edges; - *(outbuffer + offset + 0) = (u_edges.base >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (u_edges.base >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (u_edges.base >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (u_edges.base >> (8 * 3)) & 0xFF; - offset += sizeof(this->edges); - union { - float real; - uint32_t base; - } u_radius; - u_radius.real = this->radius; - *(outbuffer + offset + 0) = (u_radius.base >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (u_radius.base >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (u_radius.base >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (u_radius.base >> (8 * 3)) & 0xFF; - offset += sizeof(this->radius); - return offset; - } - - virtual int deserialize(unsigned char *inbuffer) override - { - int offset = 0; - union { - int32_t real; - uint32_t base; - } u_edges; - u_edges.base = 0; - u_edges.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); - u_edges.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - u_edges.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - u_edges.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - this->edges = u_edges.real; - offset += sizeof(this->edges); - union { - float real; - uint32_t base; - } u_radius; - u_radius.base = 0; - u_radius.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); - u_radius.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - u_radius.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - u_radius.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - this->radius = u_radius.real; - offset += sizeof(this->radius); - return offset; - } - - virtual const char * getType() override { return "turtle_actionlib/ShapeGoal"; }; - virtual const char * getMD5() override { return "3b9202ab7292cebe5a95ab2bf6b9c091"; }; - - }; - -} -#endif diff --git a/pio_workspace/lib/ros_lib/turtle_actionlib/ShapeResult.h b/pio_workspace/lib/ros_lib/turtle_actionlib/ShapeResult.h deleted file mode 100644 index deddd61..0000000 --- a/pio_workspace/lib/ros_lib/turtle_actionlib/ShapeResult.h +++ /dev/null @@ -1,86 +0,0 @@ -#ifndef _ROS_turtle_actionlib_ShapeResult_h -#define _ROS_turtle_actionlib_ShapeResult_h - -#include -#include -#include -#include "ros/msg.h" - -namespace turtle_actionlib -{ - - class ShapeResult : public ros::Msg - { - public: - typedef float _interior_angle_type; - _interior_angle_type interior_angle; - typedef float _apothem_type; - _apothem_type apothem; - - ShapeResult(): - interior_angle(0), - apothem(0) - { - } - - virtual int serialize(unsigned char *outbuffer) const override - { - int offset = 0; - union { - float real; - uint32_t base; - } u_interior_angle; - u_interior_angle.real = this->interior_angle; - *(outbuffer + offset + 0) = (u_interior_angle.base >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (u_interior_angle.base >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (u_interior_angle.base >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (u_interior_angle.base >> (8 * 3)) & 0xFF; - offset += sizeof(this->interior_angle); - union { - float real; - uint32_t base; - } u_apothem; - u_apothem.real = this->apothem; - *(outbuffer + offset + 0) = (u_apothem.base >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (u_apothem.base >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (u_apothem.base >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (u_apothem.base >> (8 * 3)) & 0xFF; - offset += sizeof(this->apothem); - return offset; - } - - virtual int deserialize(unsigned char *inbuffer) override - { - int offset = 0; - union { - float real; - uint32_t base; - } u_interior_angle; - u_interior_angle.base = 0; - u_interior_angle.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); - u_interior_angle.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - u_interior_angle.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - u_interior_angle.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - this->interior_angle = u_interior_angle.real; - offset += sizeof(this->interior_angle); - union { - float real; - uint32_t base; - } u_apothem; - u_apothem.base = 0; - u_apothem.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); - u_apothem.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - u_apothem.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - u_apothem.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - this->apothem = u_apothem.real; - offset += sizeof(this->apothem); - return offset; - } - - virtual const char * getType() override { return "turtle_actionlib/ShapeResult"; }; - virtual const char * getMD5() override { return "b06c6e2225f820dbc644270387cd1a7c"; }; - - }; - -} -#endif diff --git a/pio_workspace/lib/ros_lib/turtle_actionlib/Velocity.h b/pio_workspace/lib/ros_lib/turtle_actionlib/Velocity.h deleted file mode 100644 index 1e62c28..0000000 --- a/pio_workspace/lib/ros_lib/turtle_actionlib/Velocity.h +++ /dev/null @@ -1,86 +0,0 @@ -#ifndef _ROS_turtle_actionlib_Velocity_h -#define _ROS_turtle_actionlib_Velocity_h - -#include -#include -#include -#include "ros/msg.h" - -namespace turtle_actionlib -{ - - class Velocity : public ros::Msg - { - public: - typedef float _linear_type; - _linear_type linear; - typedef float _angular_type; - _angular_type angular; - - Velocity(): - linear(0), - angular(0) - { - } - - virtual int serialize(unsigned char *outbuffer) const override - { - int offset = 0; - union { - float real; - uint32_t base; - } u_linear; - u_linear.real = this->linear; - *(outbuffer + offset + 0) = (u_linear.base >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (u_linear.base >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (u_linear.base >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (u_linear.base >> (8 * 3)) & 0xFF; - offset += sizeof(this->linear); - union { - float real; - uint32_t base; - } u_angular; - u_angular.real = this->angular; - *(outbuffer + offset + 0) = (u_angular.base >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (u_angular.base >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (u_angular.base >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (u_angular.base >> (8 * 3)) & 0xFF; - offset += sizeof(this->angular); - return offset; - } - - virtual int deserialize(unsigned char *inbuffer) override - { - int offset = 0; - union { - float real; - uint32_t base; - } u_linear; - u_linear.base = 0; - u_linear.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); - u_linear.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - u_linear.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - u_linear.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - this->linear = u_linear.real; - offset += sizeof(this->linear); - union { - float real; - uint32_t base; - } u_angular; - u_angular.base = 0; - u_angular.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); - u_angular.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - u_angular.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - u_angular.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - this->angular = u_angular.real; - offset += sizeof(this->angular); - return offset; - } - - virtual const char * getType() override { return "turtle_actionlib/Velocity"; }; - virtual const char * getMD5() override { return "9d5c2dcd348ac8f76ce2a4307bd63a13"; }; - - }; - -} -#endif diff --git a/pio_workspace/lib/ros_lib/turtlebot3_msgs/SensorState.h b/pio_workspace/lib/ros_lib/turtlebot3_msgs/SensorState.h new file mode 100644 index 0000000..914451a --- /dev/null +++ b/pio_workspace/lib/ros_lib/turtlebot3_msgs/SensorState.h @@ -0,0 +1,238 @@ +#ifndef _ROS_turtlebot3_msgs_SensorState_h +#define _ROS_turtlebot3_msgs_SensorState_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace turtlebot3_msgs +{ + + class SensorState : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef uint8_t _bumper_type; + _bumper_type bumper; + typedef float _cliff_type; + _cliff_type cliff; + typedef float _sonar_type; + _sonar_type sonar; + typedef float _illumination_type; + _illumination_type illumination; + typedef uint8_t _led_type; + _led_type led; + typedef uint8_t _button_type; + _button_type button; + typedef bool _torque_type; + _torque_type torque; + typedef int32_t _left_encoder_type; + _left_encoder_type left_encoder; + typedef int32_t _right_encoder_type; + _right_encoder_type right_encoder; + typedef float _battery_type; + _battery_type battery; + enum { BUMPER_FORWARD = 1 }; + enum { BUMPER_BACKWARD = 2 }; + enum { CLIFF = 1 }; + enum { SONAR = 1 }; + enum { ILLUMINATION = 1 }; + enum { BUTTON0 = 1 }; + enum { BUTTON1 = 2 }; + enum { ERROR_LEFT_MOTOR = 1 }; + enum { ERROR_RIGHT_MOTOR = 2 }; + enum { TORQUE_ON = 1 }; + enum { TORQUE_OFF = 2 }; + + SensorState(): + header(), + bumper(0), + cliff(0), + sonar(0), + illumination(0), + led(0), + button(0), + torque(0), + left_encoder(0), + right_encoder(0), + battery(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->bumper >> (8 * 0)) & 0xFF; + offset += sizeof(this->bumper); + union { + float real; + uint32_t base; + } u_cliff; + u_cliff.real = this->cliff; + *(outbuffer + offset + 0) = (u_cliff.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_cliff.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_cliff.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_cliff.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->cliff); + union { + float real; + uint32_t base; + } u_sonar; + u_sonar.real = this->sonar; + *(outbuffer + offset + 0) = (u_sonar.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_sonar.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_sonar.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_sonar.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->sonar); + union { + float real; + uint32_t base; + } u_illumination; + u_illumination.real = this->illumination; + *(outbuffer + offset + 0) = (u_illumination.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_illumination.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_illumination.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_illumination.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->illumination); + *(outbuffer + offset + 0) = (this->led >> (8 * 0)) & 0xFF; + offset += sizeof(this->led); + *(outbuffer + offset + 0) = (this->button >> (8 * 0)) & 0xFF; + offset += sizeof(this->button); + union { + bool real; + uint8_t base; + } u_torque; + u_torque.real = this->torque; + *(outbuffer + offset + 0) = (u_torque.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->torque); + union { + int32_t real; + uint32_t base; + } u_left_encoder; + u_left_encoder.real = this->left_encoder; + *(outbuffer + offset + 0) = (u_left_encoder.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_left_encoder.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_left_encoder.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_left_encoder.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->left_encoder); + union { + int32_t real; + uint32_t base; + } u_right_encoder; + u_right_encoder.real = this->right_encoder; + *(outbuffer + offset + 0) = (u_right_encoder.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_right_encoder.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_right_encoder.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_right_encoder.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->right_encoder); + union { + float real; + uint32_t base; + } u_battery; + u_battery.real = this->battery; + *(outbuffer + offset + 0) = (u_battery.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_battery.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_battery.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_battery.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->battery); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + this->bumper = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->bumper); + union { + float real; + uint32_t base; + } u_cliff; + u_cliff.base = 0; + u_cliff.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_cliff.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_cliff.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_cliff.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->cliff = u_cliff.real; + offset += sizeof(this->cliff); + union { + float real; + uint32_t base; + } u_sonar; + u_sonar.base = 0; + u_sonar.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_sonar.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_sonar.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_sonar.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->sonar = u_sonar.real; + offset += sizeof(this->sonar); + union { + float real; + uint32_t base; + } u_illumination; + u_illumination.base = 0; + u_illumination.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_illumination.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_illumination.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_illumination.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->illumination = u_illumination.real; + offset += sizeof(this->illumination); + this->led = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->led); + this->button = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->button); + union { + bool real; + uint8_t base; + } u_torque; + u_torque.base = 0; + u_torque.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->torque = u_torque.real; + offset += sizeof(this->torque); + union { + int32_t real; + uint32_t base; + } u_left_encoder; + u_left_encoder.base = 0; + u_left_encoder.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_left_encoder.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_left_encoder.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_left_encoder.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->left_encoder = u_left_encoder.real; + offset += sizeof(this->left_encoder); + union { + int32_t real; + uint32_t base; + } u_right_encoder; + u_right_encoder.base = 0; + u_right_encoder.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_right_encoder.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_right_encoder.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_right_encoder.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->right_encoder = u_right_encoder.real; + offset += sizeof(this->right_encoder); + union { + float real; + uint32_t base; + } u_battery; + u_battery.base = 0; + u_battery.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_battery.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_battery.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_battery.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->battery = u_battery.real; + offset += sizeof(this->battery); + return offset; + } + + virtual const char * getType() override { return "turtlebot3_msgs/SensorState"; }; + virtual const char * getMD5() override { return "7250c1dc0b61c4190e78f528f599285f"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/turtlebot3_msgs/Sound.h b/pio_workspace/lib/ros_lib/turtlebot3_msgs/Sound.h new file mode 100644 index 0000000..60b7f9f --- /dev/null +++ b/pio_workspace/lib/ros_lib/turtlebot3_msgs/Sound.h @@ -0,0 +1,51 @@ +#ifndef _ROS_turtlebot3_msgs_Sound_h +#define _ROS_turtlebot3_msgs_Sound_h + +#include +#include +#include +#include "ros/msg.h" + +namespace turtlebot3_msgs +{ + + class Sound : public ros::Msg + { + public: + typedef uint8_t _value_type; + _value_type value; + enum { OFF = 0 }; + enum { ON = 1 }; + enum { LOW_BATTERY = 2 }; + enum { ERROR = 3 }; + enum { BUTTON1 = 4 }; + enum { BUTTON2 = 5 }; + + Sound(): + value(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->value >> (8 * 0)) & 0xFF; + offset += sizeof(this->value); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->value = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->value); + return offset; + } + + virtual const char * getType() override { return "turtlebot3_msgs/Sound"; }; + virtual const char * getMD5() override { return "e1f8c7f8a9a61383b5734fbdeca2f99a"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/turtlebot3_msgs/VersionInfo.h b/pio_workspace/lib/ros_lib/turtlebot3_msgs/VersionInfo.h new file mode 100644 index 0000000..adc5a6e --- /dev/null +++ b/pio_workspace/lib/ros_lib/turtlebot3_msgs/VersionInfo.h @@ -0,0 +1,89 @@ +#ifndef _ROS_turtlebot3_msgs_VersionInfo_h +#define _ROS_turtlebot3_msgs_VersionInfo_h + +#include +#include +#include +#include "ros/msg.h" + +namespace turtlebot3_msgs +{ + + class VersionInfo : public ros::Msg + { + public: + typedef const char* _hardware_type; + _hardware_type hardware; + typedef const char* _firmware_type; + _firmware_type firmware; + typedef const char* _software_type; + _software_type software; + + VersionInfo(): + hardware(""), + firmware(""), + software("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_hardware = strlen(this->hardware); + varToArr(outbuffer + offset, length_hardware); + offset += 4; + memcpy(outbuffer + offset, this->hardware, length_hardware); + offset += length_hardware; + uint32_t length_firmware = strlen(this->firmware); + varToArr(outbuffer + offset, length_firmware); + offset += 4; + memcpy(outbuffer + offset, this->firmware, length_firmware); + offset += length_firmware; + uint32_t length_software = strlen(this->software); + varToArr(outbuffer + offset, length_software); + offset += 4; + memcpy(outbuffer + offset, this->software, length_software); + offset += length_software; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_hardware; + arrToVar(length_hardware, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_hardware; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_hardware-1]=0; + this->hardware = (char *)(inbuffer + offset-1); + offset += length_hardware; + uint32_t length_firmware; + arrToVar(length_firmware, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_firmware; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_firmware-1]=0; + this->firmware = (char *)(inbuffer + offset-1); + offset += length_firmware; + uint32_t length_software; + arrToVar(length_software, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_software; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_software-1]=0; + this->software = (char *)(inbuffer + offset-1); + offset += length_software; + return offset; + } + + virtual const char * getType() override { return "turtlebot3_msgs/VersionInfo"; }; + virtual const char * getMD5() override { return "43e0361461af2970a33107409403ef3c"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/turtlesim/Color.h b/pio_workspace/lib/ros_lib/turtlesim/Color.h deleted file mode 100644 index 1e26d3a..0000000 --- a/pio_workspace/lib/ros_lib/turtlesim/Color.h +++ /dev/null @@ -1,59 +0,0 @@ -#ifndef _ROS_turtlesim_Color_h -#define _ROS_turtlesim_Color_h - -#include -#include -#include -#include "ros/msg.h" - -namespace turtlesim -{ - - class Color : public ros::Msg - { - public: - typedef uint8_t _r_type; - _r_type r; - typedef uint8_t _g_type; - _g_type g; - typedef uint8_t _b_type; - _b_type b; - - Color(): - r(0), - g(0), - b(0) - { - } - - virtual int serialize(unsigned char *outbuffer) const override - { - int offset = 0; - *(outbuffer + offset + 0) = (this->r >> (8 * 0)) & 0xFF; - offset += sizeof(this->r); - *(outbuffer + offset + 0) = (this->g >> (8 * 0)) & 0xFF; - offset += sizeof(this->g); - *(outbuffer + offset + 0) = (this->b >> (8 * 0)) & 0xFF; - offset += sizeof(this->b); - return offset; - } - - virtual int deserialize(unsigned char *inbuffer) override - { - int offset = 0; - this->r = ((uint8_t) (*(inbuffer + offset))); - offset += sizeof(this->r); - this->g = ((uint8_t) (*(inbuffer + offset))); - offset += sizeof(this->g); - this->b = ((uint8_t) (*(inbuffer + offset))); - offset += sizeof(this->b); - return offset; - } - - virtual const char * getType() override { return "turtlesim/Color"; }; - virtual const char * getMD5() override { return "353891e354491c51aabe32df673fb446"; }; - - }; - -} -#endif diff --git a/pio_workspace/lib/ros_lib/turtlesim/Kill.h b/pio_workspace/lib/ros_lib/turtlesim/Kill.h deleted file mode 100644 index fd98abe..0000000 --- a/pio_workspace/lib/ros_lib/turtlesim/Kill.h +++ /dev/null @@ -1,87 +0,0 @@ -#ifndef _ROS_SERVICE_Kill_h -#define _ROS_SERVICE_Kill_h -#include -#include -#include -#include "ros/msg.h" - -namespace turtlesim -{ - -static const char KILL[] = "turtlesim/Kill"; - - class KillRequest : public ros::Msg - { - public: - typedef const char* _name_type; - _name_type name; - - KillRequest(): - name("") - { - } - - virtual int serialize(unsigned char *outbuffer) const override - { - int offset = 0; - uint32_t length_name = strlen(this->name); - varToArr(outbuffer + offset, length_name); - offset += 4; - memcpy(outbuffer + offset, this->name, length_name); - offset += length_name; - return offset; - } - - virtual int deserialize(unsigned char *inbuffer) override - { - int offset = 0; - uint32_t length_name; - arrToVar(length_name, (inbuffer + offset)); - offset += 4; - for(unsigned int k= offset; k< offset+length_name; ++k){ - inbuffer[k-1]=inbuffer[k]; - } - inbuffer[offset+length_name-1]=0; - this->name = (char *)(inbuffer + offset-1); - offset += length_name; - return offset; - } - - virtual const char * getType() override { return KILL; }; - virtual const char * getMD5() override { return "c1f3d28f1b044c871e6eff2e9fc3c667"; }; - - }; - - class KillResponse : public ros::Msg - { - public: - - KillResponse() - { - } - - virtual int serialize(unsigned char *outbuffer) const override - { - int offset = 0; - return offset; - } - - virtual int deserialize(unsigned char *inbuffer) override - { - int offset = 0; - return offset; - } - - virtual const char * getType() override { return KILL; }; - virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; - - }; - - class Kill { - public: - typedef KillRequest Request; - typedef KillResponse Response; - }; - -} -#endif diff --git a/pio_workspace/lib/ros_lib/turtlesim/Pose.h b/pio_workspace/lib/ros_lib/turtlesim/Pose.h deleted file mode 100644 index 97fd863..0000000 --- a/pio_workspace/lib/ros_lib/turtlesim/Pose.h +++ /dev/null @@ -1,158 +0,0 @@ -#ifndef _ROS_turtlesim_Pose_h -#define _ROS_turtlesim_Pose_h - -#include -#include -#include -#include "ros/msg.h" - -namespace turtlesim -{ - - class Pose : public ros::Msg - { - public: - typedef float _x_type; - _x_type x; - typedef float _y_type; - _y_type y; - typedef float _theta_type; - _theta_type theta; - typedef float _linear_velocity_type; - _linear_velocity_type linear_velocity; - typedef float _angular_velocity_type; - _angular_velocity_type angular_velocity; - - Pose(): - x(0), - y(0), - theta(0), - linear_velocity(0), - angular_velocity(0) - { - } - - virtual int serialize(unsigned char *outbuffer) const override - { - int offset = 0; - union { - float real; - uint32_t base; - } u_x; - u_x.real = this->x; - *(outbuffer + offset + 0) = (u_x.base >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (u_x.base >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (u_x.base >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (u_x.base >> (8 * 3)) & 0xFF; - offset += sizeof(this->x); - union { - float real; - uint32_t base; - } u_y; - u_y.real = this->y; - *(outbuffer + offset + 0) = (u_y.base >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (u_y.base >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (u_y.base >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (u_y.base >> (8 * 3)) & 0xFF; - offset += sizeof(this->y); - union { - float real; - uint32_t base; - } u_theta; - u_theta.real = this->theta; - *(outbuffer + offset + 0) = (u_theta.base >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (u_theta.base >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (u_theta.base >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (u_theta.base >> (8 * 3)) & 0xFF; - offset += sizeof(this->theta); - union { - float real; - uint32_t base; - } u_linear_velocity; - u_linear_velocity.real = this->linear_velocity; - *(outbuffer + offset + 0) = (u_linear_velocity.base >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (u_linear_velocity.base >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (u_linear_velocity.base >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (u_linear_velocity.base >> (8 * 3)) & 0xFF; - offset += sizeof(this->linear_velocity); - union { - float real; - uint32_t base; - } u_angular_velocity; - u_angular_velocity.real = this->angular_velocity; - *(outbuffer + offset + 0) = (u_angular_velocity.base >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (u_angular_velocity.base >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (u_angular_velocity.base >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (u_angular_velocity.base >> (8 * 3)) & 0xFF; - offset += sizeof(this->angular_velocity); - return offset; - } - - virtual int deserialize(unsigned char *inbuffer) override - { - int offset = 0; - union { - float real; - uint32_t base; - } u_x; - u_x.base = 0; - u_x.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); - u_x.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - u_x.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - u_x.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - this->x = u_x.real; - offset += sizeof(this->x); - union { - float real; - uint32_t base; - } u_y; - u_y.base = 0; - u_y.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); - u_y.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - u_y.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - u_y.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - this->y = u_y.real; - offset += sizeof(this->y); - union { - float real; - uint32_t base; - } u_theta; - u_theta.base = 0; - u_theta.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); - u_theta.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - u_theta.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - u_theta.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - this->theta = u_theta.real; - offset += sizeof(this->theta); - union { - float real; - uint32_t base; - } u_linear_velocity; - u_linear_velocity.base = 0; - u_linear_velocity.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); - u_linear_velocity.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - u_linear_velocity.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - u_linear_velocity.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - this->linear_velocity = u_linear_velocity.real; - offset += sizeof(this->linear_velocity); - union { - float real; - uint32_t base; - } u_angular_velocity; - u_angular_velocity.base = 0; - u_angular_velocity.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); - u_angular_velocity.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - u_angular_velocity.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - u_angular_velocity.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - this->angular_velocity = u_angular_velocity.real; - offset += sizeof(this->angular_velocity); - return offset; - } - - virtual const char * getType() override { return "turtlesim/Pose"; }; - virtual const char * getMD5() override { return "863b248d5016ca62ea2e895ae5265cf9"; }; - - }; - -} -#endif diff --git a/pio_workspace/lib/ros_lib/turtlesim/SetPen.h b/pio_workspace/lib/ros_lib/turtlesim/SetPen.h deleted file mode 100644 index 013a8f0..0000000 --- a/pio_workspace/lib/ros_lib/turtlesim/SetPen.h +++ /dev/null @@ -1,105 +0,0 @@ -#ifndef _ROS_SERVICE_SetPen_h -#define _ROS_SERVICE_SetPen_h -#include -#include -#include -#include "ros/msg.h" - -namespace turtlesim -{ - -static const char SETPEN[] = "turtlesim/SetPen"; - - class SetPenRequest : public ros::Msg - { - public: - typedef uint8_t _r_type; - _r_type r; - typedef uint8_t _g_type; - _g_type g; - typedef uint8_t _b_type; - _b_type b; - typedef uint8_t _width_type; - _width_type width; - typedef uint8_t _off_type; - _off_type off; - - SetPenRequest(): - r(0), - g(0), - b(0), - width(0), - off(0) - { - } - - virtual int serialize(unsigned char *outbuffer) const override - { - int offset = 0; - *(outbuffer + offset + 0) = (this->r >> (8 * 0)) & 0xFF; - offset += sizeof(this->r); - *(outbuffer + offset + 0) = (this->g >> (8 * 0)) & 0xFF; - offset += sizeof(this->g); - *(outbuffer + offset + 0) = (this->b >> (8 * 0)) & 0xFF; - offset += sizeof(this->b); - *(outbuffer + offset + 0) = (this->width >> (8 * 0)) & 0xFF; - offset += sizeof(this->width); - *(outbuffer + offset + 0) = (this->off >> (8 * 0)) & 0xFF; - offset += sizeof(this->off); - return offset; - } - - virtual int deserialize(unsigned char *inbuffer) override - { - int offset = 0; - this->r = ((uint8_t) (*(inbuffer + offset))); - offset += sizeof(this->r); - this->g = ((uint8_t) (*(inbuffer + offset))); - offset += sizeof(this->g); - this->b = ((uint8_t) (*(inbuffer + offset))); - offset += sizeof(this->b); - this->width = ((uint8_t) (*(inbuffer + offset))); - offset += sizeof(this->width); - this->off = ((uint8_t) (*(inbuffer + offset))); - offset += sizeof(this->off); - return offset; - } - - virtual const char * getType() override { return SETPEN; }; - virtual const char * getMD5() override { return "9f452acce566bf0c0954594f69a8e41b"; }; - - }; - - class SetPenResponse : public ros::Msg - { - public: - - SetPenResponse() - { - } - - virtual int serialize(unsigned char *outbuffer) const override - { - int offset = 0; - return offset; - } - - virtual int deserialize(unsigned char *inbuffer) override - { - int offset = 0; - return offset; - } - - virtual const char * getType() override { return SETPEN; }; - virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; - - }; - - class SetPen { - public: - typedef SetPenRequest Request; - typedef SetPenResponse Response; - }; - -} -#endif diff --git a/pio_workspace/lib/ros_lib/turtlesim/Spawn.h b/pio_workspace/lib/ros_lib/turtlesim/Spawn.h deleted file mode 100644 index 269097e..0000000 --- a/pio_workspace/lib/ros_lib/turtlesim/Spawn.h +++ /dev/null @@ -1,176 +0,0 @@ -#ifndef _ROS_SERVICE_Spawn_h -#define _ROS_SERVICE_Spawn_h -#include -#include -#include -#include "ros/msg.h" - -namespace turtlesim -{ - -static const char SPAWN[] = "turtlesim/Spawn"; - - class SpawnRequest : public ros::Msg - { - public: - typedef float _x_type; - _x_type x; - typedef float _y_type; - _y_type y; - typedef float _theta_type; - _theta_type theta; - typedef const char* _name_type; - _name_type name; - - SpawnRequest(): - x(0), - y(0), - theta(0), - name("") - { - } - - virtual int serialize(unsigned char *outbuffer) const override - { - int offset = 0; - union { - float real; - uint32_t base; - } u_x; - u_x.real = this->x; - *(outbuffer + offset + 0) = (u_x.base >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (u_x.base >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (u_x.base >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (u_x.base >> (8 * 3)) & 0xFF; - offset += sizeof(this->x); - union { - float real; - uint32_t base; - } u_y; - u_y.real = this->y; - *(outbuffer + offset + 0) = (u_y.base >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (u_y.base >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (u_y.base >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (u_y.base >> (8 * 3)) & 0xFF; - offset += sizeof(this->y); - union { - float real; - uint32_t base; - } u_theta; - u_theta.real = this->theta; - *(outbuffer + offset + 0) = (u_theta.base >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (u_theta.base >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (u_theta.base >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (u_theta.base >> (8 * 3)) & 0xFF; - offset += sizeof(this->theta); - uint32_t length_name = strlen(this->name); - varToArr(outbuffer + offset, length_name); - offset += 4; - memcpy(outbuffer + offset, this->name, length_name); - offset += length_name; - return offset; - } - - virtual int deserialize(unsigned char *inbuffer) override - { - int offset = 0; - union { - float real; - uint32_t base; - } u_x; - u_x.base = 0; - u_x.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); - u_x.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - u_x.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - u_x.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - this->x = u_x.real; - offset += sizeof(this->x); - union { - float real; - uint32_t base; - } u_y; - u_y.base = 0; - u_y.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); - u_y.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - u_y.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - u_y.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - this->y = u_y.real; - offset += sizeof(this->y); - union { - float real; - uint32_t base; - } u_theta; - u_theta.base = 0; - u_theta.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); - u_theta.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - u_theta.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - u_theta.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - this->theta = u_theta.real; - offset += sizeof(this->theta); - uint32_t length_name; - arrToVar(length_name, (inbuffer + offset)); - offset += 4; - for(unsigned int k= offset; k< offset+length_name; ++k){ - inbuffer[k-1]=inbuffer[k]; - } - inbuffer[offset+length_name-1]=0; - this->name = (char *)(inbuffer + offset-1); - offset += length_name; - return offset; - } - - virtual const char * getType() override { return SPAWN; }; - virtual const char * getMD5() override { return "57f001c49ab7b11d699f8606c1f4f7ff"; }; - - }; - - class SpawnResponse : public ros::Msg - { - public: - typedef const char* _name_type; - _name_type name; - - SpawnResponse(): - name("") - { - } - - virtual int serialize(unsigned char *outbuffer) const override - { - int offset = 0; - uint32_t length_name = strlen(this->name); - varToArr(outbuffer + offset, length_name); - offset += 4; - memcpy(outbuffer + offset, this->name, length_name); - offset += length_name; - return offset; - } - - virtual int deserialize(unsigned char *inbuffer) override - { - int offset = 0; - uint32_t length_name; - arrToVar(length_name, (inbuffer + offset)); - offset += 4; - for(unsigned int k= offset; k< offset+length_name; ++k){ - inbuffer[k-1]=inbuffer[k]; - } - inbuffer[offset+length_name-1]=0; - this->name = (char *)(inbuffer + offset-1); - offset += length_name; - return offset; - } - - virtual const char * getType() override { return SPAWN; }; - virtual const char * getMD5() override { return "c1f3d28f1b044c871e6eff2e9fc3c667"; }; - - }; - - class Spawn { - public: - typedef SpawnRequest Request; - typedef SpawnResponse Response; - }; - -} -#endif diff --git a/pio_workspace/lib/ros_lib/turtlesim/TeleportRelative.h b/pio_workspace/lib/ros_lib/turtlesim/TeleportRelative.h deleted file mode 100644 index fa6667f..0000000 --- a/pio_workspace/lib/ros_lib/turtlesim/TeleportRelative.h +++ /dev/null @@ -1,118 +0,0 @@ -#ifndef _ROS_SERVICE_TeleportRelative_h -#define _ROS_SERVICE_TeleportRelative_h -#include -#include -#include -#include "ros/msg.h" - -namespace turtlesim -{ - -static const char TELEPORTRELATIVE[] = "turtlesim/TeleportRelative"; - - class TeleportRelativeRequest : public ros::Msg - { - public: - typedef float _linear_type; - _linear_type linear; - typedef float _angular_type; - _angular_type angular; - - TeleportRelativeRequest(): - linear(0), - angular(0) - { - } - - virtual int serialize(unsigned char *outbuffer) const override - { - int offset = 0; - union { - float real; - uint32_t base; - } u_linear; - u_linear.real = this->linear; - *(outbuffer + offset + 0) = (u_linear.base >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (u_linear.base >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (u_linear.base >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (u_linear.base >> (8 * 3)) & 0xFF; - offset += sizeof(this->linear); - union { - float real; - uint32_t base; - } u_angular; - u_angular.real = this->angular; - *(outbuffer + offset + 0) = (u_angular.base >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (u_angular.base >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (u_angular.base >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (u_angular.base >> (8 * 3)) & 0xFF; - offset += sizeof(this->angular); - return offset; - } - - virtual int deserialize(unsigned char *inbuffer) override - { - int offset = 0; - union { - float real; - uint32_t base; - } u_linear; - u_linear.base = 0; - u_linear.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); - u_linear.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - u_linear.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - u_linear.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - this->linear = u_linear.real; - offset += sizeof(this->linear); - union { - float real; - uint32_t base; - } u_angular; - u_angular.base = 0; - u_angular.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); - u_angular.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - u_angular.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - u_angular.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - this->angular = u_angular.real; - offset += sizeof(this->angular); - return offset; - } - - virtual const char * getType() override { return TELEPORTRELATIVE; }; - virtual const char * getMD5() override { return "9d5c2dcd348ac8f76ce2a4307bd63a13"; }; - - }; - - class TeleportRelativeResponse : public ros::Msg - { - public: - - TeleportRelativeResponse() - { - } - - virtual int serialize(unsigned char *outbuffer) const override - { - int offset = 0; - return offset; - } - - virtual int deserialize(unsigned char *inbuffer) override - { - int offset = 0; - return offset; - } - - virtual const char * getType() override { return TELEPORTRELATIVE; }; - virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; - - }; - - class TeleportRelative { - public: - typedef TeleportRelativeRequest Request; - typedef TeleportRelativeResponse Response; - }; - -} -#endif diff --git a/pio_workspace/lib/ros_lib/uuid_msgs/UniqueID.h b/pio_workspace/lib/ros_lib/uuid_msgs/UniqueID.h new file mode 100644 index 0000000..b35e693 --- /dev/null +++ b/pio_workspace/lib/ros_lib/uuid_msgs/UniqueID.h @@ -0,0 +1,48 @@ +#ifndef _ROS_uuid_msgs_UniqueID_h +#define _ROS_uuid_msgs_UniqueID_h + +#include +#include +#include +#include "ros/msg.h" + +namespace uuid_msgs +{ + + class UniqueID : public ros::Msg + { + public: + uint8_t uuid[16]; + + UniqueID(): + uuid() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + for( uint32_t i = 0; i < 16; i++){ + *(outbuffer + offset + 0) = (this->uuid[i] >> (8 * 0)) & 0xFF; + offset += sizeof(this->uuid[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + for( uint32_t i = 0; i < 16; i++){ + this->uuid[i] = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->uuid[i]); + } + return offset; + } + + virtual const char * getType() override { return "uuid_msgs/UniqueID"; }; + virtual const char * getMD5() override { return "fec2a93b6f5367ee8112c9c0b41ff310"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/velodyne_msgs/VelodynePacket.h b/pio_workspace/lib/ros_lib/velodyne_msgs/VelodynePacket.h new file mode 100644 index 0000000..9c45fce --- /dev/null +++ b/pio_workspace/lib/ros_lib/velodyne_msgs/VelodynePacket.h @@ -0,0 +1,72 @@ +#ifndef _ROS_velodyne_msgs_VelodynePacket_h +#define _ROS_velodyne_msgs_VelodynePacket_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/time.h" + +namespace velodyne_msgs +{ + + class VelodynePacket : public ros::Msg + { + public: + typedef ros::Time _stamp_type; + _stamp_type stamp; + uint8_t data[1206]; + + VelodynePacket(): + stamp(), + data() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->stamp.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->stamp.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->stamp.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->stamp.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->stamp.sec); + *(outbuffer + offset + 0) = (this->stamp.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->stamp.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->stamp.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->stamp.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->stamp.nsec); + for( uint32_t i = 0; i < 1206; i++){ + *(outbuffer + offset + 0) = (this->data[i] >> (8 * 0)) & 0xFF; + offset += sizeof(this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->stamp.sec = ((uint32_t) (*(inbuffer + offset))); + this->stamp.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->stamp.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->stamp.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->stamp.sec); + this->stamp.nsec = ((uint32_t) (*(inbuffer + offset))); + this->stamp.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->stamp.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->stamp.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->stamp.nsec); + for( uint32_t i = 0; i < 1206; i++){ + this->data[i] = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->data[i]); + } + return offset; + } + + virtual const char * getType() override { return "velodyne_msgs/VelodynePacket"; }; + virtual const char * getMD5() override { return "ae4f90a23256f44e82baa08dd45c3456"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/velodyne_msgs/VelodyneScan.h b/pio_workspace/lib/ros_lib/velodyne_msgs/VelodyneScan.h new file mode 100644 index 0000000..c7c73db --- /dev/null +++ b/pio_workspace/lib/ros_lib/velodyne_msgs/VelodyneScan.h @@ -0,0 +1,70 @@ +#ifndef _ROS_velodyne_msgs_VelodyneScan_h +#define _ROS_velodyne_msgs_VelodyneScan_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "velodyne_msgs/VelodynePacket.h" + +namespace velodyne_msgs +{ + + class VelodyneScan : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t packets_length; + typedef velodyne_msgs::VelodynePacket _packets_type; + _packets_type st_packets; + _packets_type * packets; + + VelodyneScan(): + header(), + packets_length(0), st_packets(), packets(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->packets_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->packets_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->packets_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->packets_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->packets_length); + for( uint32_t i = 0; i < packets_length; i++){ + offset += this->packets[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t packets_lengthT = ((uint32_t) (*(inbuffer + offset))); + packets_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + packets_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + packets_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->packets_length); + if(packets_lengthT > packets_length) + this->packets = (velodyne_msgs::VelodynePacket*)realloc(this->packets, packets_lengthT * sizeof(velodyne_msgs::VelodynePacket)); + packets_length = packets_lengthT; + for( uint32_t i = 0; i < packets_length; i++){ + offset += this->st_packets.deserialize(inbuffer + offset); + memcpy( &(this->packets[i]), &(this->st_packets), sizeof(velodyne_msgs::VelodynePacket)); + } + return offset; + } + + virtual const char * getType() override { return "velodyne_msgs/VelodyneScan"; }; + virtual const char * getMD5() override { return "50804fc9533a0e579e6322c04ae70566"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/xsens_mti_driver/XsStatusWord.h b/pio_workspace/lib/ros_lib/xsens_mti_driver/XsStatusWord.h new file mode 100644 index 0000000..63225f6 --- /dev/null +++ b/pio_workspace/lib/ros_lib/xsens_mti_driver/XsStatusWord.h @@ -0,0 +1,383 @@ +#ifndef _ROS_xsens_mti_driver_XsStatusWord_h +#define _ROS_xsens_mti_driver_XsStatusWord_h + +#include +#include +#include +#include "ros/msg.h" + +namespace xsens_mti_driver +{ + + class XsStatusWord : public ros::Msg + { + public: + typedef bool _selftest_type; + _selftest_type selftest; + typedef bool _filter_valid_type; + _filter_valid_type filter_valid; + typedef bool _gnss_fix_type; + _gnss_fix_type gnss_fix; + typedef uint8_t _no_rotation_update_status_type; + _no_rotation_update_status_type no_rotation_update_status; + typedef bool _representative_motion_type; + _representative_motion_type representative_motion; + typedef bool _clock_bias_estimation_type; + _clock_bias_estimation_type clock_bias_estimation; + typedef bool _clipflag_acc_x_type; + _clipflag_acc_x_type clipflag_acc_x; + typedef bool _clipflag_acc_y_type; + _clipflag_acc_y_type clipflag_acc_y; + typedef bool _clipflag_acc_z_type; + _clipflag_acc_z_type clipflag_acc_z; + typedef bool _clipflag_gyr_x_type; + _clipflag_gyr_x_type clipflag_gyr_x; + typedef bool _clipflag_gyr_y_type; + _clipflag_gyr_y_type clipflag_gyr_y; + typedef bool _clipflag_gyr_z_type; + _clipflag_gyr_z_type clipflag_gyr_z; + typedef bool _clipflag_mag_x_type; + _clipflag_mag_x_type clipflag_mag_x; + typedef bool _clipflag_mag_y_type; + _clipflag_mag_y_type clipflag_mag_y; + typedef bool _clipflag_mag_z_type; + _clipflag_mag_z_type clipflag_mag_z; + typedef bool _clipping_indication_type; + _clipping_indication_type clipping_indication; + typedef bool _syncin_marker_type; + _syncin_marker_type syncin_marker; + typedef bool _syncout_marker_type; + _syncout_marker_type syncout_marker; + typedef uint8_t _filter_mode_type; + _filter_mode_type filter_mode; + typedef bool _have_gnss_time_pulse_type; + _have_gnss_time_pulse_type have_gnss_time_pulse; + typedef uint8_t _rtk_status_type; + _rtk_status_type rtk_status; + + XsStatusWord(): + selftest(0), + filter_valid(0), + gnss_fix(0), + no_rotation_update_status(0), + representative_motion(0), + clock_bias_estimation(0), + clipflag_acc_x(0), + clipflag_acc_y(0), + clipflag_acc_z(0), + clipflag_gyr_x(0), + clipflag_gyr_y(0), + clipflag_gyr_z(0), + clipflag_mag_x(0), + clipflag_mag_y(0), + clipflag_mag_z(0), + clipping_indication(0), + syncin_marker(0), + syncout_marker(0), + filter_mode(0), + have_gnss_time_pulse(0), + rtk_status(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_selftest; + u_selftest.real = this->selftest; + *(outbuffer + offset + 0) = (u_selftest.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->selftest); + union { + bool real; + uint8_t base; + } u_filter_valid; + u_filter_valid.real = this->filter_valid; + *(outbuffer + offset + 0) = (u_filter_valid.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->filter_valid); + union { + bool real; + uint8_t base; + } u_gnss_fix; + u_gnss_fix.real = this->gnss_fix; + *(outbuffer + offset + 0) = (u_gnss_fix.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->gnss_fix); + *(outbuffer + offset + 0) = (this->no_rotation_update_status >> (8 * 0)) & 0xFF; + offset += sizeof(this->no_rotation_update_status); + union { + bool real; + uint8_t base; + } u_representative_motion; + u_representative_motion.real = this->representative_motion; + *(outbuffer + offset + 0) = (u_representative_motion.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->representative_motion); + union { + bool real; + uint8_t base; + } u_clock_bias_estimation; + u_clock_bias_estimation.real = this->clock_bias_estimation; + *(outbuffer + offset + 0) = (u_clock_bias_estimation.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->clock_bias_estimation); + union { + bool real; + uint8_t base; + } u_clipflag_acc_x; + u_clipflag_acc_x.real = this->clipflag_acc_x; + *(outbuffer + offset + 0) = (u_clipflag_acc_x.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->clipflag_acc_x); + union { + bool real; + uint8_t base; + } u_clipflag_acc_y; + u_clipflag_acc_y.real = this->clipflag_acc_y; + *(outbuffer + offset + 0) = (u_clipflag_acc_y.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->clipflag_acc_y); + union { + bool real; + uint8_t base; + } u_clipflag_acc_z; + u_clipflag_acc_z.real = this->clipflag_acc_z; + *(outbuffer + offset + 0) = (u_clipflag_acc_z.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->clipflag_acc_z); + union { + bool real; + uint8_t base; + } u_clipflag_gyr_x; + u_clipflag_gyr_x.real = this->clipflag_gyr_x; + *(outbuffer + offset + 0) = (u_clipflag_gyr_x.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->clipflag_gyr_x); + union { + bool real; + uint8_t base; + } u_clipflag_gyr_y; + u_clipflag_gyr_y.real = this->clipflag_gyr_y; + *(outbuffer + offset + 0) = (u_clipflag_gyr_y.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->clipflag_gyr_y); + union { + bool real; + uint8_t base; + } u_clipflag_gyr_z; + u_clipflag_gyr_z.real = this->clipflag_gyr_z; + *(outbuffer + offset + 0) = (u_clipflag_gyr_z.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->clipflag_gyr_z); + union { + bool real; + uint8_t base; + } u_clipflag_mag_x; + u_clipflag_mag_x.real = this->clipflag_mag_x; + *(outbuffer + offset + 0) = (u_clipflag_mag_x.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->clipflag_mag_x); + union { + bool real; + uint8_t base; + } u_clipflag_mag_y; + u_clipflag_mag_y.real = this->clipflag_mag_y; + *(outbuffer + offset + 0) = (u_clipflag_mag_y.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->clipflag_mag_y); + union { + bool real; + uint8_t base; + } u_clipflag_mag_z; + u_clipflag_mag_z.real = this->clipflag_mag_z; + *(outbuffer + offset + 0) = (u_clipflag_mag_z.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->clipflag_mag_z); + union { + bool real; + uint8_t base; + } u_clipping_indication; + u_clipping_indication.real = this->clipping_indication; + *(outbuffer + offset + 0) = (u_clipping_indication.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->clipping_indication); + union { + bool real; + uint8_t base; + } u_syncin_marker; + u_syncin_marker.real = this->syncin_marker; + *(outbuffer + offset + 0) = (u_syncin_marker.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->syncin_marker); + union { + bool real; + uint8_t base; + } u_syncout_marker; + u_syncout_marker.real = this->syncout_marker; + *(outbuffer + offset + 0) = (u_syncout_marker.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->syncout_marker); + *(outbuffer + offset + 0) = (this->filter_mode >> (8 * 0)) & 0xFF; + offset += sizeof(this->filter_mode); + union { + bool real; + uint8_t base; + } u_have_gnss_time_pulse; + u_have_gnss_time_pulse.real = this->have_gnss_time_pulse; + *(outbuffer + offset + 0) = (u_have_gnss_time_pulse.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->have_gnss_time_pulse); + *(outbuffer + offset + 0) = (this->rtk_status >> (8 * 0)) & 0xFF; + offset += sizeof(this->rtk_status); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_selftest; + u_selftest.base = 0; + u_selftest.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->selftest = u_selftest.real; + offset += sizeof(this->selftest); + union { + bool real; + uint8_t base; + } u_filter_valid; + u_filter_valid.base = 0; + u_filter_valid.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->filter_valid = u_filter_valid.real; + offset += sizeof(this->filter_valid); + union { + bool real; + uint8_t base; + } u_gnss_fix; + u_gnss_fix.base = 0; + u_gnss_fix.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->gnss_fix = u_gnss_fix.real; + offset += sizeof(this->gnss_fix); + this->no_rotation_update_status = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->no_rotation_update_status); + union { + bool real; + uint8_t base; + } u_representative_motion; + u_representative_motion.base = 0; + u_representative_motion.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->representative_motion = u_representative_motion.real; + offset += sizeof(this->representative_motion); + union { + bool real; + uint8_t base; + } u_clock_bias_estimation; + u_clock_bias_estimation.base = 0; + u_clock_bias_estimation.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->clock_bias_estimation = u_clock_bias_estimation.real; + offset += sizeof(this->clock_bias_estimation); + union { + bool real; + uint8_t base; + } u_clipflag_acc_x; + u_clipflag_acc_x.base = 0; + u_clipflag_acc_x.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->clipflag_acc_x = u_clipflag_acc_x.real; + offset += sizeof(this->clipflag_acc_x); + union { + bool real; + uint8_t base; + } u_clipflag_acc_y; + u_clipflag_acc_y.base = 0; + u_clipflag_acc_y.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->clipflag_acc_y = u_clipflag_acc_y.real; + offset += sizeof(this->clipflag_acc_y); + union { + bool real; + uint8_t base; + } u_clipflag_acc_z; + u_clipflag_acc_z.base = 0; + u_clipflag_acc_z.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->clipflag_acc_z = u_clipflag_acc_z.real; + offset += sizeof(this->clipflag_acc_z); + union { + bool real; + uint8_t base; + } u_clipflag_gyr_x; + u_clipflag_gyr_x.base = 0; + u_clipflag_gyr_x.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->clipflag_gyr_x = u_clipflag_gyr_x.real; + offset += sizeof(this->clipflag_gyr_x); + union { + bool real; + uint8_t base; + } u_clipflag_gyr_y; + u_clipflag_gyr_y.base = 0; + u_clipflag_gyr_y.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->clipflag_gyr_y = u_clipflag_gyr_y.real; + offset += sizeof(this->clipflag_gyr_y); + union { + bool real; + uint8_t base; + } u_clipflag_gyr_z; + u_clipflag_gyr_z.base = 0; + u_clipflag_gyr_z.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->clipflag_gyr_z = u_clipflag_gyr_z.real; + offset += sizeof(this->clipflag_gyr_z); + union { + bool real; + uint8_t base; + } u_clipflag_mag_x; + u_clipflag_mag_x.base = 0; + u_clipflag_mag_x.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->clipflag_mag_x = u_clipflag_mag_x.real; + offset += sizeof(this->clipflag_mag_x); + union { + bool real; + uint8_t base; + } u_clipflag_mag_y; + u_clipflag_mag_y.base = 0; + u_clipflag_mag_y.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->clipflag_mag_y = u_clipflag_mag_y.real; + offset += sizeof(this->clipflag_mag_y); + union { + bool real; + uint8_t base; + } u_clipflag_mag_z; + u_clipflag_mag_z.base = 0; + u_clipflag_mag_z.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->clipflag_mag_z = u_clipflag_mag_z.real; + offset += sizeof(this->clipflag_mag_z); + union { + bool real; + uint8_t base; + } u_clipping_indication; + u_clipping_indication.base = 0; + u_clipping_indication.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->clipping_indication = u_clipping_indication.real; + offset += sizeof(this->clipping_indication); + union { + bool real; + uint8_t base; + } u_syncin_marker; + u_syncin_marker.base = 0; + u_syncin_marker.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->syncin_marker = u_syncin_marker.real; + offset += sizeof(this->syncin_marker); + union { + bool real; + uint8_t base; + } u_syncout_marker; + u_syncout_marker.base = 0; + u_syncout_marker.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->syncout_marker = u_syncout_marker.real; + offset += sizeof(this->syncout_marker); + this->filter_mode = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->filter_mode); + union { + bool real; + uint8_t base; + } u_have_gnss_time_pulse; + u_have_gnss_time_pulse.base = 0; + u_have_gnss_time_pulse.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->have_gnss_time_pulse = u_have_gnss_time_pulse.real; + offset += sizeof(this->have_gnss_time_pulse); + this->rtk_status = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->rtk_status); + return offset; + } + + virtual const char * getType() override { return "xsens_mti_driver/XsStatusWord"; }; + virtual const char * getMD5() override { return "dad684e003fb0f5d7e08711072d64f83"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/zed_interfaces/BoundingBox2Df.h b/pio_workspace/lib/ros_lib/zed_interfaces/BoundingBox2Df.h new file mode 100644 index 0000000..d33ea1b --- /dev/null +++ b/pio_workspace/lib/ros_lib/zed_interfaces/BoundingBox2Df.h @@ -0,0 +1,47 @@ +#ifndef _ROS_zed_interfaces_BoundingBox2Df_h +#define _ROS_zed_interfaces_BoundingBox2Df_h + +#include +#include +#include +#include "ros/msg.h" +#include "zed_interfaces/Keypoint2Df.h" + +namespace zed_interfaces +{ + + class BoundingBox2Df : public ros::Msg + { + public: + zed_interfaces::Keypoint2Df corners[4]; + + BoundingBox2Df(): + corners() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + for( uint32_t i = 0; i < 4; i++){ + offset += this->corners[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + for( uint32_t i = 0; i < 4; i++){ + offset += this->corners[i].deserialize(inbuffer + offset); + } + return offset; + } + + virtual const char * getType() override { return "zed_interfaces/BoundingBox2Df"; }; + virtual const char * getMD5() override { return "8ce1e9ea2b267e0dce506c975b1391b0"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/zed_interfaces/BoundingBox2Di.h b/pio_workspace/lib/ros_lib/zed_interfaces/BoundingBox2Di.h new file mode 100644 index 0000000..945883d --- /dev/null +++ b/pio_workspace/lib/ros_lib/zed_interfaces/BoundingBox2Di.h @@ -0,0 +1,47 @@ +#ifndef _ROS_zed_interfaces_BoundingBox2Di_h +#define _ROS_zed_interfaces_BoundingBox2Di_h + +#include +#include +#include +#include "ros/msg.h" +#include "zed_interfaces/Keypoint2Di.h" + +namespace zed_interfaces +{ + + class BoundingBox2Di : public ros::Msg + { + public: + zed_interfaces::Keypoint2Di corners[4]; + + BoundingBox2Di(): + corners() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + for( uint32_t i = 0; i < 4; i++){ + offset += this->corners[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + for( uint32_t i = 0; i < 4; i++){ + offset += this->corners[i].deserialize(inbuffer + offset); + } + return offset; + } + + virtual const char * getType() override { return "zed_interfaces/BoundingBox2Di"; }; + virtual const char * getMD5() override { return "48f8f53e85eafba49fb9648f6258d114"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/zed_interfaces/BoundingBox3D.h b/pio_workspace/lib/ros_lib/zed_interfaces/BoundingBox3D.h new file mode 100644 index 0000000..e93ea80 --- /dev/null +++ b/pio_workspace/lib/ros_lib/zed_interfaces/BoundingBox3D.h @@ -0,0 +1,47 @@ +#ifndef _ROS_zed_interfaces_BoundingBox3D_h +#define _ROS_zed_interfaces_BoundingBox3D_h + +#include +#include +#include +#include "ros/msg.h" +#include "zed_interfaces/Keypoint3D.h" + +namespace zed_interfaces +{ + + class BoundingBox3D : public ros::Msg + { + public: + zed_interfaces::Keypoint3D corners[8]; + + BoundingBox3D(): + corners() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + for( uint32_t i = 0; i < 8; i++){ + offset += this->corners[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + for( uint32_t i = 0; i < 8; i++){ + offset += this->corners[i].deserialize(inbuffer + offset); + } + return offset; + } + + virtual const char * getType() override { return "zed_interfaces/BoundingBox3D"; }; + virtual const char * getMD5() override { return "3750b81144ba1b26f88ce23eeb4efd34"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/zed_interfaces/Keypoint2Df.h b/pio_workspace/lib/ros_lib/zed_interfaces/Keypoint2Df.h new file mode 100644 index 0000000..74f2912 --- /dev/null +++ b/pio_workspace/lib/ros_lib/zed_interfaces/Keypoint2Df.h @@ -0,0 +1,65 @@ +#ifndef _ROS_zed_interfaces_Keypoint2Df_h +#define _ROS_zed_interfaces_Keypoint2Df_h + +#include +#include +#include +#include "ros/msg.h" + +namespace zed_interfaces +{ + + class Keypoint2Df : public ros::Msg + { + public: + float kp[2]; + + Keypoint2Df(): + kp() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + for( uint32_t i = 0; i < 2; i++){ + union { + float real; + uint32_t base; + } u_kpi; + u_kpi.real = this->kp[i]; + *(outbuffer + offset + 0) = (u_kpi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_kpi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_kpi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_kpi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->kp[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + for( uint32_t i = 0; i < 2; i++){ + union { + float real; + uint32_t base; + } u_kpi; + u_kpi.base = 0; + u_kpi.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_kpi.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_kpi.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_kpi.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->kp[i] = u_kpi.real; + offset += sizeof(this->kp[i]); + } + return offset; + } + + virtual const char * getType() override { return "zed_interfaces/Keypoint2Df"; }; + virtual const char * getMD5() override { return "cf5ebcd50ce370a9811fce73a9095e7b"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/zed_interfaces/Keypoint2Di.h b/pio_workspace/lib/ros_lib/zed_interfaces/Keypoint2Di.h new file mode 100644 index 0000000..1b71116 --- /dev/null +++ b/pio_workspace/lib/ros_lib/zed_interfaces/Keypoint2Di.h @@ -0,0 +1,54 @@ +#ifndef _ROS_zed_interfaces_Keypoint2Di_h +#define _ROS_zed_interfaces_Keypoint2Di_h + +#include +#include +#include +#include "ros/msg.h" + +namespace zed_interfaces +{ + + class Keypoint2Di : public ros::Msg + { + public: + uint32_t kp[2]; + + Keypoint2Di(): + kp() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + for( uint32_t i = 0; i < 2; i++){ + *(outbuffer + offset + 0) = (this->kp[i] >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->kp[i] >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->kp[i] >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->kp[i] >> (8 * 3)) & 0xFF; + offset += sizeof(this->kp[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + for( uint32_t i = 0; i < 2; i++){ + this->kp[i] = ((uint32_t) (*(inbuffer + offset))); + this->kp[i] |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->kp[i] |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->kp[i] |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->kp[i]); + } + return offset; + } + + virtual const char * getType() override { return "zed_interfaces/Keypoint2Di"; }; + virtual const char * getMD5() override { return "5d23739e59e90009d64f8e07a5e96e2b"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/zed_interfaces/Keypoint3D.h b/pio_workspace/lib/ros_lib/zed_interfaces/Keypoint3D.h new file mode 100644 index 0000000..af8bb8a --- /dev/null +++ b/pio_workspace/lib/ros_lib/zed_interfaces/Keypoint3D.h @@ -0,0 +1,65 @@ +#ifndef _ROS_zed_interfaces_Keypoint3D_h +#define _ROS_zed_interfaces_Keypoint3D_h + +#include +#include +#include +#include "ros/msg.h" + +namespace zed_interfaces +{ + + class Keypoint3D : public ros::Msg + { + public: + float kp[3]; + + Keypoint3D(): + kp() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + for( uint32_t i = 0; i < 3; i++){ + union { + float real; + uint32_t base; + } u_kpi; + u_kpi.real = this->kp[i]; + *(outbuffer + offset + 0) = (u_kpi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_kpi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_kpi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_kpi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->kp[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + for( uint32_t i = 0; i < 3; i++){ + union { + float real; + uint32_t base; + } u_kpi; + u_kpi.base = 0; + u_kpi.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_kpi.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_kpi.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_kpi.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->kp[i] = u_kpi.real; + offset += sizeof(this->kp[i]); + } + return offset; + } + + virtual const char * getType() override { return "zed_interfaces/Keypoint3D"; }; + virtual const char * getMD5() override { return "f8f017135a763e4b81273453c9d8ef62"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/zed_interfaces/Object.h b/pio_workspace/lib/ros_lib/zed_interfaces/Object.h new file mode 100644 index 0000000..c1d617c --- /dev/null +++ b/pio_workspace/lib/ros_lib/zed_interfaces/Object.h @@ -0,0 +1,378 @@ +#ifndef _ROS_zed_interfaces_Object_h +#define _ROS_zed_interfaces_Object_h + +#include +#include +#include +#include "ros/msg.h" +#include "zed_interfaces/BoundingBox2Di.h" +#include "zed_interfaces/BoundingBox3D.h" +#include "zed_interfaces/BoundingBox2Df.h" +#include "zed_interfaces/Skeleton2D.h" +#include "zed_interfaces/Skeleton3D.h" + +namespace zed_interfaces +{ + + class Object : public ros::Msg + { + public: + typedef const char* _label_type; + _label_type label; + typedef int16_t _label_id_type; + _label_id_type label_id; + typedef int16_t _instance_id_type; + _instance_id_type instance_id; + typedef const char* _sublabel_type; + _sublabel_type sublabel; + typedef float _confidence_type; + _confidence_type confidence; + float position[3]; + float position_covariance[6]; + float velocity[3]; + typedef bool _tracking_available_type; + _tracking_available_type tracking_available; + typedef int8_t _tracking_state_type; + _tracking_state_type tracking_state; + typedef int8_t _action_state_type; + _action_state_type action_state; + typedef zed_interfaces::BoundingBox2Di _bounding_box_2d_type; + _bounding_box_2d_type bounding_box_2d; + typedef zed_interfaces::BoundingBox3D _bounding_box_3d_type; + _bounding_box_3d_type bounding_box_3d; + float dimensions_3d[3]; + typedef bool _skeleton_available_type; + _skeleton_available_type skeleton_available; + typedef zed_interfaces::BoundingBox2Df _head_bounding_box_2d_type; + _head_bounding_box_2d_type head_bounding_box_2d; + typedef zed_interfaces::BoundingBox3D _head_bounding_box_3d_type; + _head_bounding_box_3d_type head_bounding_box_3d; + float head_position[3]; + typedef zed_interfaces::Skeleton2D _skeleton_2d_type; + _skeleton_2d_type skeleton_2d; + typedef zed_interfaces::Skeleton3D _skeleton_3d_type; + _skeleton_3d_type skeleton_3d; + + Object(): + label(""), + label_id(0), + instance_id(0), + sublabel(""), + confidence(0), + position(), + position_covariance(), + velocity(), + tracking_available(0), + tracking_state(0), + action_state(0), + bounding_box_2d(), + bounding_box_3d(), + dimensions_3d(), + skeleton_available(0), + head_bounding_box_2d(), + head_bounding_box_3d(), + head_position(), + skeleton_2d(), + skeleton_3d() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_label = strlen(this->label); + varToArr(outbuffer + offset, length_label); + offset += 4; + memcpy(outbuffer + offset, this->label, length_label); + offset += length_label; + union { + int16_t real; + uint16_t base; + } u_label_id; + u_label_id.real = this->label_id; + *(outbuffer + offset + 0) = (u_label_id.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_label_id.base >> (8 * 1)) & 0xFF; + offset += sizeof(this->label_id); + union { + int16_t real; + uint16_t base; + } u_instance_id; + u_instance_id.real = this->instance_id; + *(outbuffer + offset + 0) = (u_instance_id.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_instance_id.base >> (8 * 1)) & 0xFF; + offset += sizeof(this->instance_id); + uint32_t length_sublabel = strlen(this->sublabel); + varToArr(outbuffer + offset, length_sublabel); + offset += 4; + memcpy(outbuffer + offset, this->sublabel, length_sublabel); + offset += length_sublabel; + union { + float real; + uint32_t base; + } u_confidence; + u_confidence.real = this->confidence; + *(outbuffer + offset + 0) = (u_confidence.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_confidence.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_confidence.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_confidence.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->confidence); + for( uint32_t i = 0; i < 3; i++){ + union { + float real; + uint32_t base; + } u_positioni; + u_positioni.real = this->position[i]; + *(outbuffer + offset + 0) = (u_positioni.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_positioni.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_positioni.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_positioni.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->position[i]); + } + for( uint32_t i = 0; i < 6; i++){ + union { + float real; + uint32_t base; + } u_position_covariancei; + u_position_covariancei.real = this->position_covariance[i]; + *(outbuffer + offset + 0) = (u_position_covariancei.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_position_covariancei.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_position_covariancei.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_position_covariancei.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->position_covariance[i]); + } + for( uint32_t i = 0; i < 3; i++){ + union { + float real; + uint32_t base; + } u_velocityi; + u_velocityi.real = this->velocity[i]; + *(outbuffer + offset + 0) = (u_velocityi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_velocityi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_velocityi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_velocityi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->velocity[i]); + } + union { + bool real; + uint8_t base; + } u_tracking_available; + u_tracking_available.real = this->tracking_available; + *(outbuffer + offset + 0) = (u_tracking_available.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->tracking_available); + union { + int8_t real; + uint8_t base; + } u_tracking_state; + u_tracking_state.real = this->tracking_state; + *(outbuffer + offset + 0) = (u_tracking_state.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->tracking_state); + union { + int8_t real; + uint8_t base; + } u_action_state; + u_action_state.real = this->action_state; + *(outbuffer + offset + 0) = (u_action_state.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->action_state); + offset += this->bounding_box_2d.serialize(outbuffer + offset); + offset += this->bounding_box_3d.serialize(outbuffer + offset); + for( uint32_t i = 0; i < 3; i++){ + union { + float real; + uint32_t base; + } u_dimensions_3di; + u_dimensions_3di.real = this->dimensions_3d[i]; + *(outbuffer + offset + 0) = (u_dimensions_3di.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_dimensions_3di.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_dimensions_3di.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_dimensions_3di.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->dimensions_3d[i]); + } + union { + bool real; + uint8_t base; + } u_skeleton_available; + u_skeleton_available.real = this->skeleton_available; + *(outbuffer + offset + 0) = (u_skeleton_available.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->skeleton_available); + offset += this->head_bounding_box_2d.serialize(outbuffer + offset); + offset += this->head_bounding_box_3d.serialize(outbuffer + offset); + for( uint32_t i = 0; i < 3; i++){ + union { + float real; + uint32_t base; + } u_head_positioni; + u_head_positioni.real = this->head_position[i]; + *(outbuffer + offset + 0) = (u_head_positioni.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_head_positioni.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_head_positioni.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_head_positioni.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->head_position[i]); + } + offset += this->skeleton_2d.serialize(outbuffer + offset); + offset += this->skeleton_3d.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_label; + arrToVar(length_label, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_label; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_label-1]=0; + this->label = (char *)(inbuffer + offset-1); + offset += length_label; + union { + int16_t real; + uint16_t base; + } u_label_id; + u_label_id.base = 0; + u_label_id.base |= ((uint16_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_label_id.base |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->label_id = u_label_id.real; + offset += sizeof(this->label_id); + union { + int16_t real; + uint16_t base; + } u_instance_id; + u_instance_id.base = 0; + u_instance_id.base |= ((uint16_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_instance_id.base |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->instance_id = u_instance_id.real; + offset += sizeof(this->instance_id); + uint32_t length_sublabel; + arrToVar(length_sublabel, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_sublabel; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_sublabel-1]=0; + this->sublabel = (char *)(inbuffer + offset-1); + offset += length_sublabel; + union { + float real; + uint32_t base; + } u_confidence; + u_confidence.base = 0; + u_confidence.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_confidence.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_confidence.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_confidence.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->confidence = u_confidence.real; + offset += sizeof(this->confidence); + for( uint32_t i = 0; i < 3; i++){ + union { + float real; + uint32_t base; + } u_positioni; + u_positioni.base = 0; + u_positioni.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_positioni.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_positioni.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_positioni.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->position[i] = u_positioni.real; + offset += sizeof(this->position[i]); + } + for( uint32_t i = 0; i < 6; i++){ + union { + float real; + uint32_t base; + } u_position_covariancei; + u_position_covariancei.base = 0; + u_position_covariancei.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_position_covariancei.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_position_covariancei.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_position_covariancei.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->position_covariance[i] = u_position_covariancei.real; + offset += sizeof(this->position_covariance[i]); + } + for( uint32_t i = 0; i < 3; i++){ + union { + float real; + uint32_t base; + } u_velocityi; + u_velocityi.base = 0; + u_velocityi.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_velocityi.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_velocityi.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_velocityi.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->velocity[i] = u_velocityi.real; + offset += sizeof(this->velocity[i]); + } + union { + bool real; + uint8_t base; + } u_tracking_available; + u_tracking_available.base = 0; + u_tracking_available.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->tracking_available = u_tracking_available.real; + offset += sizeof(this->tracking_available); + union { + int8_t real; + uint8_t base; + } u_tracking_state; + u_tracking_state.base = 0; + u_tracking_state.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->tracking_state = u_tracking_state.real; + offset += sizeof(this->tracking_state); + union { + int8_t real; + uint8_t base; + } u_action_state; + u_action_state.base = 0; + u_action_state.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->action_state = u_action_state.real; + offset += sizeof(this->action_state); + offset += this->bounding_box_2d.deserialize(inbuffer + offset); + offset += this->bounding_box_3d.deserialize(inbuffer + offset); + for( uint32_t i = 0; i < 3; i++){ + union { + float real; + uint32_t base; + } u_dimensions_3di; + u_dimensions_3di.base = 0; + u_dimensions_3di.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_dimensions_3di.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_dimensions_3di.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_dimensions_3di.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->dimensions_3d[i] = u_dimensions_3di.real; + offset += sizeof(this->dimensions_3d[i]); + } + union { + bool real; + uint8_t base; + } u_skeleton_available; + u_skeleton_available.base = 0; + u_skeleton_available.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->skeleton_available = u_skeleton_available.real; + offset += sizeof(this->skeleton_available); + offset += this->head_bounding_box_2d.deserialize(inbuffer + offset); + offset += this->head_bounding_box_3d.deserialize(inbuffer + offset); + for( uint32_t i = 0; i < 3; i++){ + union { + float real; + uint32_t base; + } u_head_positioni; + u_head_positioni.base = 0; + u_head_positioni.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_head_positioni.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_head_positioni.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_head_positioni.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->head_position[i] = u_head_positioni.real; + offset += sizeof(this->head_position[i]); + } + offset += this->skeleton_2d.deserialize(inbuffer + offset); + offset += this->skeleton_3d.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "zed_interfaces/Object"; }; + virtual const char * getMD5() override { return "850ee8ff1282c46cfce0a7d14dd04611"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/zed_interfaces/ObjectsStamped.h b/pio_workspace/lib/ros_lib/zed_interfaces/ObjectsStamped.h new file mode 100644 index 0000000..0a802e8 --- /dev/null +++ b/pio_workspace/lib/ros_lib/zed_interfaces/ObjectsStamped.h @@ -0,0 +1,70 @@ +#ifndef _ROS_zed_interfaces_ObjectsStamped_h +#define _ROS_zed_interfaces_ObjectsStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "zed_interfaces/Object.h" + +namespace zed_interfaces +{ + + class ObjectsStamped : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t objects_length; + typedef zed_interfaces::Object _objects_type; + _objects_type st_objects; + _objects_type * objects; + + ObjectsStamped(): + header(), + objects_length(0), st_objects(), objects(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->objects_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->objects_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->objects_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->objects_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->objects_length); + for( uint32_t i = 0; i < objects_length; i++){ + offset += this->objects[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t objects_lengthT = ((uint32_t) (*(inbuffer + offset))); + objects_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + objects_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + objects_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->objects_length); + if(objects_lengthT > objects_length) + this->objects = (zed_interfaces::Object*)realloc(this->objects, objects_lengthT * sizeof(zed_interfaces::Object)); + objects_length = objects_lengthT; + for( uint32_t i = 0; i < objects_length; i++){ + offset += this->st_objects.deserialize(inbuffer + offset); + memcpy( &(this->objects[i]), &(this->st_objects), sizeof(zed_interfaces::Object)); + } + return offset; + } + + virtual const char * getType() override { return "zed_interfaces/ObjectsStamped"; }; + virtual const char * getMD5() override { return "b138979dc4c884a00915d2a416aa75c6"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/zed_interfaces/PlaneStamped.h b/pio_workspace/lib/ros_lib/zed_interfaces/PlaneStamped.h new file mode 100644 index 0000000..ff3e4f1 --- /dev/null +++ b/pio_workspace/lib/ros_lib/zed_interfaces/PlaneStamped.h @@ -0,0 +1,106 @@ +#ifndef _ROS_zed_interfaces_PlaneStamped_h +#define _ROS_zed_interfaces_PlaneStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "shape_msgs/Mesh.h" +#include "shape_msgs/Plane.h" +#include "geometry_msgs/Point32.h" +#include "geometry_msgs/Transform.h" +#include "geometry_msgs/Polygon.h" + +namespace zed_interfaces +{ + + class PlaneStamped : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef shape_msgs::Mesh _mesh_type; + _mesh_type mesh; + typedef shape_msgs::Plane _coefficients_type; + _coefficients_type coefficients; + typedef geometry_msgs::Point32 _normal_type; + _normal_type normal; + typedef geometry_msgs::Point32 _center_type; + _center_type center; + typedef geometry_msgs::Transform _pose_type; + _pose_type pose; + float extents[2]; + typedef geometry_msgs::Polygon _bounds_type; + _bounds_type bounds; + + PlaneStamped(): + header(), + mesh(), + coefficients(), + normal(), + center(), + pose(), + extents(), + bounds() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->mesh.serialize(outbuffer + offset); + offset += this->coefficients.serialize(outbuffer + offset); + offset += this->normal.serialize(outbuffer + offset); + offset += this->center.serialize(outbuffer + offset); + offset += this->pose.serialize(outbuffer + offset); + for( uint32_t i = 0; i < 2; i++){ + union { + float real; + uint32_t base; + } u_extentsi; + u_extentsi.real = this->extents[i]; + *(outbuffer + offset + 0) = (u_extentsi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_extentsi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_extentsi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_extentsi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->extents[i]); + } + offset += this->bounds.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->mesh.deserialize(inbuffer + offset); + offset += this->coefficients.deserialize(inbuffer + offset); + offset += this->normal.deserialize(inbuffer + offset); + offset += this->center.deserialize(inbuffer + offset); + offset += this->pose.deserialize(inbuffer + offset); + for( uint32_t i = 0; i < 2; i++){ + union { + float real; + uint32_t base; + } u_extentsi; + u_extentsi.base = 0; + u_extentsi.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_extentsi.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_extentsi.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_extentsi.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->extents[i] = u_extentsi.real; + offset += sizeof(this->extents[i]); + } + offset += this->bounds.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "zed_interfaces/PlaneStamped"; }; + virtual const char * getMD5() override { return "1ae4cda68097919aea83add5dc8f86c1"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/zed_interfaces/PosTrackStatus.h b/pio_workspace/lib/ros_lib/zed_interfaces/PosTrackStatus.h new file mode 100644 index 0000000..f3ade03 --- /dev/null +++ b/pio_workspace/lib/ros_lib/zed_interfaces/PosTrackStatus.h @@ -0,0 +1,50 @@ +#ifndef _ROS_zed_interfaces_PosTrackStatus_h +#define _ROS_zed_interfaces_PosTrackStatus_h + +#include +#include +#include +#include "ros/msg.h" + +namespace zed_interfaces +{ + + class PosTrackStatus : public ros::Msg + { + public: + typedef uint8_t _status_type; + _status_type status; + enum { SEARCHING = 0 }; + enum { OK = 1 }; + enum { OFF = 2 }; + enum { FPS_TOO_LOW = 3 }; + enum { SEARCHING_FLOOR_PLANE = 3 }; + + PosTrackStatus(): + status(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->status >> (8 * 0)) & 0xFF; + offset += sizeof(this->status); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->status = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->status); + return offset; + } + + virtual const char * getType() override { return "zed_interfaces/PosTrackStatus"; }; + virtual const char * getMD5() override { return "16c87ef5951f2667d385cacb152a0d50"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/zed_interfaces/RGBDSensors.h b/pio_workspace/lib/ros_lib/zed_interfaces/RGBDSensors.h new file mode 100644 index 0000000..7e5795d --- /dev/null +++ b/pio_workspace/lib/ros_lib/zed_interfaces/RGBDSensors.h @@ -0,0 +1,78 @@ +#ifndef _ROS_zed_interfaces_RGBDSensors_h +#define _ROS_zed_interfaces_RGBDSensors_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "sensor_msgs/CameraInfo.h" +#include "sensor_msgs/Image.h" +#include "sensor_msgs/Imu.h" +#include "sensor_msgs/MagneticField.h" + +namespace zed_interfaces +{ + + class RGBDSensors : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef sensor_msgs::CameraInfo _rgbCameraInfo_type; + _rgbCameraInfo_type rgbCameraInfo; + typedef sensor_msgs::CameraInfo _depthCameraInfo_type; + _depthCameraInfo_type depthCameraInfo; + typedef sensor_msgs::Image _rgb_type; + _rgb_type rgb; + typedef sensor_msgs::Image _depth_type; + _depth_type depth; + typedef sensor_msgs::Imu _imu_type; + _imu_type imu; + typedef sensor_msgs::MagneticField _mag_type; + _mag_type mag; + + RGBDSensors(): + header(), + rgbCameraInfo(), + depthCameraInfo(), + rgb(), + depth(), + imu(), + mag() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->rgbCameraInfo.serialize(outbuffer + offset); + offset += this->depthCameraInfo.serialize(outbuffer + offset); + offset += this->rgb.serialize(outbuffer + offset); + offset += this->depth.serialize(outbuffer + offset); + offset += this->imu.serialize(outbuffer + offset); + offset += this->mag.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->rgbCameraInfo.deserialize(inbuffer + offset); + offset += this->depthCameraInfo.deserialize(inbuffer + offset); + offset += this->rgb.deserialize(inbuffer + offset); + offset += this->depth.deserialize(inbuffer + offset); + offset += this->imu.deserialize(inbuffer + offset); + offset += this->mag.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "zed_interfaces/RGBDSensors"; }; + virtual const char * getMD5() override { return "815807ecc415e89b119ed074d28d12dd"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/zed_interfaces/Skeleton2D.h b/pio_workspace/lib/ros_lib/zed_interfaces/Skeleton2D.h new file mode 100644 index 0000000..2b6ca0f --- /dev/null +++ b/pio_workspace/lib/ros_lib/zed_interfaces/Skeleton2D.h @@ -0,0 +1,47 @@ +#ifndef _ROS_zed_interfaces_Skeleton2D_h +#define _ROS_zed_interfaces_Skeleton2D_h + +#include +#include +#include +#include "ros/msg.h" +#include "zed_interfaces/Keypoint2Df.h" + +namespace zed_interfaces +{ + + class Skeleton2D : public ros::Msg + { + public: + zed_interfaces::Keypoint2Df keypoints[18]; + + Skeleton2D(): + keypoints() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + for( uint32_t i = 0; i < 18; i++){ + offset += this->keypoints[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + for( uint32_t i = 0; i < 18; i++){ + offset += this->keypoints[i].deserialize(inbuffer + offset); + } + return offset; + } + + virtual const char * getType() override { return "zed_interfaces/Skeleton2D"; }; + virtual const char * getMD5() override { return "1754703e1a6ce338ad28b9ee81fb712a"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/zed_interfaces/Skeleton3D.h b/pio_workspace/lib/ros_lib/zed_interfaces/Skeleton3D.h new file mode 100644 index 0000000..18027b9 --- /dev/null +++ b/pio_workspace/lib/ros_lib/zed_interfaces/Skeleton3D.h @@ -0,0 +1,47 @@ +#ifndef _ROS_zed_interfaces_Skeleton3D_h +#define _ROS_zed_interfaces_Skeleton3D_h + +#include +#include +#include +#include "ros/msg.h" +#include "zed_interfaces/Keypoint3D.h" + +namespace zed_interfaces +{ + + class Skeleton3D : public ros::Msg + { + public: + zed_interfaces::Keypoint3D keypoints[18]; + + Skeleton3D(): + keypoints() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + for( uint32_t i = 0; i < 18; i++){ + offset += this->keypoints[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + for( uint32_t i = 0; i < 18; i++){ + offset += this->keypoints[i].deserialize(inbuffer + offset); + } + return offset; + } + + virtual const char * getType() override { return "zed_interfaces/Skeleton3D"; }; + virtual const char * getMD5() override { return "b704d948cb88b776b9f51ee392e13c62"; }; + + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/zed_interfaces/reset_odometry.h b/pio_workspace/lib/ros_lib/zed_interfaces/reset_odometry.h new file mode 100644 index 0000000..bdc469a --- /dev/null +++ b/pio_workspace/lib/ros_lib/zed_interfaces/reset_odometry.h @@ -0,0 +1,88 @@ +#ifndef _ROS_SERVICE_reset_odometry_h +#define _ROS_SERVICE_reset_odometry_h +#include +#include +#include +#include "ros/msg.h" + +namespace zed_interfaces +{ + +static const char RESET_ODOMETRY[] = "zed_interfaces/reset_odometry"; + + class reset_odometryRequest : public ros::Msg + { + public: + + reset_odometryRequest() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + return offset; + } + + virtual const char * getType() override { return RESET_ODOMETRY; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class reset_odometryResponse : public ros::Msg + { + public: + typedef bool _reset_done_type; + _reset_done_type reset_done; + + reset_odometryResponse(): + reset_done(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_reset_done; + u_reset_done.real = this->reset_done; + *(outbuffer + offset + 0) = (u_reset_done.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->reset_done); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_reset_done; + u_reset_done.base = 0; + u_reset_done.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->reset_done = u_reset_done.real; + offset += sizeof(this->reset_done); + return offset; + } + + virtual const char * getType() override { return RESET_ODOMETRY; }; + virtual const char * getMD5() override { return "e1e87fc9e9e6c154eca93b9fa292cc05"; }; + + }; + + class reset_odometry { + public: + typedef reset_odometryRequest Request; + typedef reset_odometryResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/zed_interfaces/reset_roi.h b/pio_workspace/lib/ros_lib/zed_interfaces/reset_roi.h new file mode 100644 index 0000000..3374b14 --- /dev/null +++ b/pio_workspace/lib/ros_lib/zed_interfaces/reset_roi.h @@ -0,0 +1,88 @@ +#ifndef _ROS_SERVICE_reset_roi_h +#define _ROS_SERVICE_reset_roi_h +#include +#include +#include +#include "ros/msg.h" + +namespace zed_interfaces +{ + +static const char RESET_ROI[] = "zed_interfaces/reset_roi"; + + class reset_roiRequest : public ros::Msg + { + public: + + reset_roiRequest() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + return offset; + } + + virtual const char * getType() override { return RESET_ROI; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class reset_roiResponse : public ros::Msg + { + public: + typedef bool _reset_done_type; + _reset_done_type reset_done; + + reset_roiResponse(): + reset_done(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_reset_done; + u_reset_done.real = this->reset_done; + *(outbuffer + offset + 0) = (u_reset_done.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->reset_done); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_reset_done; + u_reset_done.base = 0; + u_reset_done.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->reset_done = u_reset_done.real; + offset += sizeof(this->reset_done); + return offset; + } + + virtual const char * getType() override { return RESET_ROI; }; + virtual const char * getMD5() override { return "e1e87fc9e9e6c154eca93b9fa292cc05"; }; + + }; + + class reset_roi { + public: + typedef reset_roiRequest Request; + typedef reset_roiResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/zed_interfaces/reset_tracking.h b/pio_workspace/lib/ros_lib/zed_interfaces/reset_tracking.h new file mode 100644 index 0000000..e7e17ea --- /dev/null +++ b/pio_workspace/lib/ros_lib/zed_interfaces/reset_tracking.h @@ -0,0 +1,88 @@ +#ifndef _ROS_SERVICE_reset_tracking_h +#define _ROS_SERVICE_reset_tracking_h +#include +#include +#include +#include "ros/msg.h" + +namespace zed_interfaces +{ + +static const char RESET_TRACKING[] = "zed_interfaces/reset_tracking"; + + class reset_trackingRequest : public ros::Msg + { + public: + + reset_trackingRequest() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + return offset; + } + + virtual const char * getType() override { return RESET_TRACKING; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class reset_trackingResponse : public ros::Msg + { + public: + typedef bool _reset_done_type; + _reset_done_type reset_done; + + reset_trackingResponse(): + reset_done(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_reset_done; + u_reset_done.real = this->reset_done; + *(outbuffer + offset + 0) = (u_reset_done.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->reset_done); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_reset_done; + u_reset_done.base = 0; + u_reset_done.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->reset_done = u_reset_done.real; + offset += sizeof(this->reset_done); + return offset; + } + + virtual const char * getType() override { return RESET_TRACKING; }; + virtual const char * getMD5() override { return "e1e87fc9e9e6c154eca93b9fa292cc05"; }; + + }; + + class reset_tracking { + public: + typedef reset_trackingRequest Request; + typedef reset_trackingResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/zed_interfaces/save_3d_map.h b/pio_workspace/lib/ros_lib/zed_interfaces/save_3d_map.h new file mode 100644 index 0000000..5e14adb --- /dev/null +++ b/pio_workspace/lib/ros_lib/zed_interfaces/save_3d_map.h @@ -0,0 +1,129 @@ +#ifndef _ROS_SERVICE_save_3d_map_h +#define _ROS_SERVICE_save_3d_map_h +#include +#include +#include +#include "ros/msg.h" + +namespace zed_interfaces +{ + +static const char SAVE_3D_MAP[] = "zed_interfaces/save_3d_map"; + + class save_3d_mapRequest : public ros::Msg + { + public: + typedef const char* _map_filename_type; + _map_filename_type map_filename; + typedef uint8_t _file_format_type; + _file_format_type file_format; + + save_3d_mapRequest(): + map_filename(""), + file_format(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_map_filename = strlen(this->map_filename); + varToArr(outbuffer + offset, length_map_filename); + offset += 4; + memcpy(outbuffer + offset, this->map_filename, length_map_filename); + offset += length_map_filename; + *(outbuffer + offset + 0) = (this->file_format >> (8 * 0)) & 0xFF; + offset += sizeof(this->file_format); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_map_filename; + arrToVar(length_map_filename, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_map_filename; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_map_filename-1]=0; + this->map_filename = (char *)(inbuffer + offset-1); + offset += length_map_filename; + this->file_format = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->file_format); + return offset; + } + + virtual const char * getType() override { return SAVE_3D_MAP; }; + virtual const char * getMD5() override { return "56677e0c5e358a82a455f7d0d9b27a0e"; }; + + }; + + class save_3d_mapResponse : public ros::Msg + { + public: + typedef bool _result_type; + _result_type result; + typedef const char* _info_type; + _info_type info; + + save_3d_mapResponse(): + result(0), + info("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_result; + u_result.real = this->result; + *(outbuffer + offset + 0) = (u_result.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->result); + uint32_t length_info = strlen(this->info); + varToArr(outbuffer + offset, length_info); + offset += 4; + memcpy(outbuffer + offset, this->info, length_info); + offset += length_info; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_result; + u_result.base = 0; + u_result.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->result = u_result.real; + offset += sizeof(this->result); + uint32_t length_info; + arrToVar(length_info, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_info; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_info-1]=0; + this->info = (char *)(inbuffer + offset-1); + offset += length_info; + return offset; + } + + virtual const char * getType() override { return SAVE_3D_MAP; }; + virtual const char * getMD5() override { return "929b8c0d7b68510a3f501a60258c746e"; }; + + }; + + class save_3d_map { + public: + typedef save_3d_mapRequest Request; + typedef save_3d_mapResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/zed_interfaces/save_area_memory.h b/pio_workspace/lib/ros_lib/zed_interfaces/save_area_memory.h new file mode 100644 index 0000000..5e9270a --- /dev/null +++ b/pio_workspace/lib/ros_lib/zed_interfaces/save_area_memory.h @@ -0,0 +1,122 @@ +#ifndef _ROS_SERVICE_save_area_memory_h +#define _ROS_SERVICE_save_area_memory_h +#include +#include +#include +#include "ros/msg.h" + +namespace zed_interfaces +{ + +static const char SAVE_AREA_MEMORY[] = "zed_interfaces/save_area_memory"; + + class save_area_memoryRequest : public ros::Msg + { + public: + typedef const char* _area_memory_filename_type; + _area_memory_filename_type area_memory_filename; + + save_area_memoryRequest(): + area_memory_filename("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_area_memory_filename = strlen(this->area_memory_filename); + varToArr(outbuffer + offset, length_area_memory_filename); + offset += 4; + memcpy(outbuffer + offset, this->area_memory_filename, length_area_memory_filename); + offset += length_area_memory_filename; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_area_memory_filename; + arrToVar(length_area_memory_filename, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_area_memory_filename; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_area_memory_filename-1]=0; + this->area_memory_filename = (char *)(inbuffer + offset-1); + offset += length_area_memory_filename; + return offset; + } + + virtual const char * getType() override { return SAVE_AREA_MEMORY; }; + virtual const char * getMD5() override { return "ab0f15ea60791be9468710556673c3a9"; }; + + }; + + class save_area_memoryResponse : public ros::Msg + { + public: + typedef bool _result_type; + _result_type result; + typedef const char* _info_type; + _info_type info; + + save_area_memoryResponse(): + result(0), + info("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_result; + u_result.real = this->result; + *(outbuffer + offset + 0) = (u_result.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->result); + uint32_t length_info = strlen(this->info); + varToArr(outbuffer + offset, length_info); + offset += 4; + memcpy(outbuffer + offset, this->info, length_info); + offset += length_info; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_result; + u_result.base = 0; + u_result.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->result = u_result.real; + offset += sizeof(this->result); + uint32_t length_info; + arrToVar(length_info, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_info; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_info-1]=0; + this->info = (char *)(inbuffer + offset-1); + offset += length_info; + return offset; + } + + virtual const char * getType() override { return SAVE_AREA_MEMORY; }; + virtual const char * getMD5() override { return "929b8c0d7b68510a3f501a60258c746e"; }; + + }; + + class save_area_memory { + public: + typedef save_area_memoryRequest Request; + typedef save_area_memoryResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/zed_interfaces/set_led_status.h b/pio_workspace/lib/ros_lib/zed_interfaces/set_led_status.h new file mode 100644 index 0000000..c9c6006 --- /dev/null +++ b/pio_workspace/lib/ros_lib/zed_interfaces/set_led_status.h @@ -0,0 +1,106 @@ +#ifndef _ROS_SERVICE_set_led_status_h +#define _ROS_SERVICE_set_led_status_h +#include +#include +#include +#include "ros/msg.h" + +namespace zed_interfaces +{ + +static const char SET_LED_STATUS[] = "zed_interfaces/set_led_status"; + + class set_led_statusRequest : public ros::Msg + { + public: + typedef bool _led_enabled_type; + _led_enabled_type led_enabled; + + set_led_statusRequest(): + led_enabled(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_led_enabled; + u_led_enabled.real = this->led_enabled; + *(outbuffer + offset + 0) = (u_led_enabled.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->led_enabled); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_led_enabled; + u_led_enabled.base = 0; + u_led_enabled.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->led_enabled = u_led_enabled.real; + offset += sizeof(this->led_enabled); + return offset; + } + + virtual const char * getType() override { return SET_LED_STATUS; }; + virtual const char * getMD5() override { return "f2e0f7cf20d5f300d5382e9eab56e737"; }; + + }; + + class set_led_statusResponse : public ros::Msg + { + public: + typedef bool _done_type; + _done_type done; + + set_led_statusResponse(): + done(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_done; + u_done.real = this->done; + *(outbuffer + offset + 0) = (u_done.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->done); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_done; + u_done.base = 0; + u_done.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->done = u_done.real; + offset += sizeof(this->done); + return offset; + } + + virtual const char * getType() override { return SET_LED_STATUS; }; + virtual const char * getMD5() override { return "89bb254424e4cffedbf494e7b0ddbfea"; }; + + }; + + class set_led_status { + public: + typedef set_led_statusRequest Request; + typedef set_led_statusResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/zed_interfaces/set_pose.h b/pio_workspace/lib/ros_lib/zed_interfaces/set_pose.h new file mode 100644 index 0000000..84c4b91 --- /dev/null +++ b/pio_workspace/lib/ros_lib/zed_interfaces/set_pose.h @@ -0,0 +1,232 @@ +#ifndef _ROS_SERVICE_set_pose_h +#define _ROS_SERVICE_set_pose_h +#include +#include +#include +#include "ros/msg.h" + +namespace zed_interfaces +{ + +static const char SET_POSE[] = "zed_interfaces/set_pose"; + + class set_poseRequest : public ros::Msg + { + public: + typedef float _x_type; + _x_type x; + typedef float _y_type; + _y_type y; + typedef float _z_type; + _z_type z; + typedef float _R_type; + _R_type R; + typedef float _P_type; + _P_type P; + typedef float _Y_type; + _Y_type Y; + + set_poseRequest(): + x(0), + y(0), + z(0), + R(0), + P(0), + Y(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + float real; + uint32_t base; + } u_x; + u_x.real = this->x; + *(outbuffer + offset + 0) = (u_x.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_x.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_x.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_x.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->x); + union { + float real; + uint32_t base; + } u_y; + u_y.real = this->y; + *(outbuffer + offset + 0) = (u_y.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_y.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_y.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_y.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->y); + union { + float real; + uint32_t base; + } u_z; + u_z.real = this->z; + *(outbuffer + offset + 0) = (u_z.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_z.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_z.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_z.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->z); + union { + float real; + uint32_t base; + } u_R; + u_R.real = this->R; + *(outbuffer + offset + 0) = (u_R.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_R.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_R.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_R.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->R); + union { + float real; + uint32_t base; + } u_P; + u_P.real = this->P; + *(outbuffer + offset + 0) = (u_P.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_P.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_P.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_P.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->P); + union { + float real; + uint32_t base; + } u_Y; + u_Y.real = this->Y; + *(outbuffer + offset + 0) = (u_Y.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_Y.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_Y.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_Y.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->Y); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + float real; + uint32_t base; + } u_x; + u_x.base = 0; + u_x.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->x = u_x.real; + offset += sizeof(this->x); + union { + float real; + uint32_t base; + } u_y; + u_y.base = 0; + u_y.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->y = u_y.real; + offset += sizeof(this->y); + union { + float real; + uint32_t base; + } u_z; + u_z.base = 0; + u_z.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_z.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_z.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_z.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->z = u_z.real; + offset += sizeof(this->z); + union { + float real; + uint32_t base; + } u_R; + u_R.base = 0; + u_R.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_R.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_R.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_R.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->R = u_R.real; + offset += sizeof(this->R); + union { + float real; + uint32_t base; + } u_P; + u_P.base = 0; + u_P.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_P.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_P.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_P.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->P = u_P.real; + offset += sizeof(this->P); + union { + float real; + uint32_t base; + } u_Y; + u_Y.base = 0; + u_Y.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_Y.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_Y.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_Y.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->Y = u_Y.real; + offset += sizeof(this->Y); + return offset; + } + + virtual const char * getType() override { return SET_POSE; }; + virtual const char * getMD5() override { return "2d76cb67dcd5839567c5ce0b111a67e4"; }; + + }; + + class set_poseResponse : public ros::Msg + { + public: + typedef bool _done_type; + _done_type done; + + set_poseResponse(): + done(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_done; + u_done.real = this->done; + *(outbuffer + offset + 0) = (u_done.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->done); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_done; + u_done.base = 0; + u_done.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->done = u_done.real; + offset += sizeof(this->done); + return offset; + } + + virtual const char * getType() override { return SET_POSE; }; + virtual const char * getMD5() override { return "89bb254424e4cffedbf494e7b0ddbfea"; }; + + }; + + class set_pose { + public: + typedef set_poseRequest Request; + typedef set_poseResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/zed_interfaces/set_roi.h b/pio_workspace/lib/ros_lib/zed_interfaces/set_roi.h new file mode 100644 index 0000000..c893ec8 --- /dev/null +++ b/pio_workspace/lib/ros_lib/zed_interfaces/set_roi.h @@ -0,0 +1,122 @@ +#ifndef _ROS_SERVICE_set_roi_h +#define _ROS_SERVICE_set_roi_h +#include +#include +#include +#include "ros/msg.h" + +namespace zed_interfaces +{ + +static const char SET_ROI[] = "zed_interfaces/set_roi"; + + class set_roiRequest : public ros::Msg + { + public: + typedef const char* _roi_type; + _roi_type roi; + + set_roiRequest(): + roi("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_roi = strlen(this->roi); + varToArr(outbuffer + offset, length_roi); + offset += 4; + memcpy(outbuffer + offset, this->roi, length_roi); + offset += length_roi; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_roi; + arrToVar(length_roi, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_roi; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_roi-1]=0; + this->roi = (char *)(inbuffer + offset-1); + offset += length_roi; + return offset; + } + + virtual const char * getType() override { return SET_ROI; }; + virtual const char * getMD5() override { return "f8582525019d538cfd188d29f0c1b797"; }; + + }; + + class set_roiResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + typedef const char* _message_type; + _message_type message; + + set_roiResponse(): + success(0), + message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_message = strlen(this->message); + varToArr(outbuffer + offset, length_message); + offset += 4; + memcpy(outbuffer + offset, this->message, length_message); + offset += length_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_message; + arrToVar(length_message, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_message-1]=0; + this->message = (char *)(inbuffer + offset-1); + offset += length_message; + return offset; + } + + virtual const char * getType() override { return SET_ROI; }; + virtual const char * getMD5() override { return "937c9679a518e3a18d831e57125ea522"; }; + + }; + + class set_roi { + public: + typedef set_roiRequest Request; + typedef set_roiResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/zed_interfaces/start_3d_mapping.h b/pio_workspace/lib/ros_lib/zed_interfaces/start_3d_mapping.h new file mode 100644 index 0000000..6dc0e35 --- /dev/null +++ b/pio_workspace/lib/ros_lib/zed_interfaces/start_3d_mapping.h @@ -0,0 +1,160 @@ +#ifndef _ROS_SERVICE_start_3d_mapping_h +#define _ROS_SERVICE_start_3d_mapping_h +#include +#include +#include +#include "ros/msg.h" + +namespace zed_interfaces +{ + +static const char START_3D_MAPPING[] = "zed_interfaces/start_3d_mapping"; + + class start_3d_mappingRequest : public ros::Msg + { + public: + typedef float _resolution_type; + _resolution_type resolution; + typedef float _max_mapping_range_type; + _max_mapping_range_type max_mapping_range; + typedef float _fused_pointcloud_freq_type; + _fused_pointcloud_freq_type fused_pointcloud_freq; + + start_3d_mappingRequest(): + resolution(0), + max_mapping_range(0), + fused_pointcloud_freq(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + float real; + uint32_t base; + } u_resolution; + u_resolution.real = this->resolution; + *(outbuffer + offset + 0) = (u_resolution.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_resolution.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_resolution.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_resolution.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->resolution); + union { + float real; + uint32_t base; + } u_max_mapping_range; + u_max_mapping_range.real = this->max_mapping_range; + *(outbuffer + offset + 0) = (u_max_mapping_range.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_max_mapping_range.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_max_mapping_range.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_max_mapping_range.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->max_mapping_range); + union { + float real; + uint32_t base; + } u_fused_pointcloud_freq; + u_fused_pointcloud_freq.real = this->fused_pointcloud_freq; + *(outbuffer + offset + 0) = (u_fused_pointcloud_freq.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_fused_pointcloud_freq.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_fused_pointcloud_freq.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_fused_pointcloud_freq.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->fused_pointcloud_freq); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + float real; + uint32_t base; + } u_resolution; + u_resolution.base = 0; + u_resolution.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_resolution.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_resolution.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_resolution.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->resolution = u_resolution.real; + offset += sizeof(this->resolution); + union { + float real; + uint32_t base; + } u_max_mapping_range; + u_max_mapping_range.base = 0; + u_max_mapping_range.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_max_mapping_range.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_max_mapping_range.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_max_mapping_range.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->max_mapping_range = u_max_mapping_range.real; + offset += sizeof(this->max_mapping_range); + union { + float real; + uint32_t base; + } u_fused_pointcloud_freq; + u_fused_pointcloud_freq.base = 0; + u_fused_pointcloud_freq.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_fused_pointcloud_freq.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_fused_pointcloud_freq.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_fused_pointcloud_freq.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->fused_pointcloud_freq = u_fused_pointcloud_freq.real; + offset += sizeof(this->fused_pointcloud_freq); + return offset; + } + + virtual const char * getType() override { return START_3D_MAPPING; }; + virtual const char * getMD5() override { return "187ac9d444c9f537f1d5a7db64b8e12a"; }; + + }; + + class start_3d_mappingResponse : public ros::Msg + { + public: + typedef bool _done_type; + _done_type done; + + start_3d_mappingResponse(): + done(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_done; + u_done.real = this->done; + *(outbuffer + offset + 0) = (u_done.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->done); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_done; + u_done.base = 0; + u_done.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->done = u_done.real; + offset += sizeof(this->done); + return offset; + } + + virtual const char * getType() override { return START_3D_MAPPING; }; + virtual const char * getMD5() override { return "89bb254424e4cffedbf494e7b0ddbfea"; }; + + }; + + class start_3d_mapping { + public: + typedef start_3d_mappingRequest Request; + typedef start_3d_mappingResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/zed_interfaces/start_object_detection.h b/pio_workspace/lib/ros_lib/zed_interfaces/start_object_detection.h new file mode 100644 index 0000000..0fdfd1f --- /dev/null +++ b/pio_workspace/lib/ros_lib/zed_interfaces/start_object_detection.h @@ -0,0 +1,316 @@ +#ifndef _ROS_SERVICE_start_object_detection_h +#define _ROS_SERVICE_start_object_detection_h +#include +#include +#include +#include "ros/msg.h" + +namespace zed_interfaces +{ + +static const char START_OBJECT_DETECTION[] = "zed_interfaces/start_object_detection"; + + class start_object_detectionRequest : public ros::Msg + { + public: + typedef int8_t _model_type; + _model_type model; + typedef float _confidence_type; + _confidence_type confidence; + typedef float _max_range_type; + _max_range_type max_range; + typedef bool _tracking_type; + _tracking_type tracking; + typedef bool _sk_body_fitting_type; + _sk_body_fitting_type sk_body_fitting; + typedef bool _mc_people_type; + _mc_people_type mc_people; + typedef bool _mc_vehicles_type; + _mc_vehicles_type mc_vehicles; + typedef bool _mc_bag_type; + _mc_bag_type mc_bag; + typedef bool _mc_animal_type; + _mc_animal_type mc_animal; + typedef bool _mc_electronics_type; + _mc_electronics_type mc_electronics; + typedef bool _mc_fruit_vegetable_type; + _mc_fruit_vegetable_type mc_fruit_vegetable; + typedef bool _mc_sport_type; + _mc_sport_type mc_sport; + + start_object_detectionRequest(): + model(0), + confidence(0), + max_range(0), + tracking(0), + sk_body_fitting(0), + mc_people(0), + mc_vehicles(0), + mc_bag(0), + mc_animal(0), + mc_electronics(0), + mc_fruit_vegetable(0), + mc_sport(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + int8_t real; + uint8_t base; + } u_model; + u_model.real = this->model; + *(outbuffer + offset + 0) = (u_model.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->model); + union { + float real; + uint32_t base; + } u_confidence; + u_confidence.real = this->confidence; + *(outbuffer + offset + 0) = (u_confidence.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_confidence.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_confidence.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_confidence.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->confidence); + union { + float real; + uint32_t base; + } u_max_range; + u_max_range.real = this->max_range; + *(outbuffer + offset + 0) = (u_max_range.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_max_range.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_max_range.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_max_range.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->max_range); + union { + bool real; + uint8_t base; + } u_tracking; + u_tracking.real = this->tracking; + *(outbuffer + offset + 0) = (u_tracking.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->tracking); + union { + bool real; + uint8_t base; + } u_sk_body_fitting; + u_sk_body_fitting.real = this->sk_body_fitting; + *(outbuffer + offset + 0) = (u_sk_body_fitting.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->sk_body_fitting); + union { + bool real; + uint8_t base; + } u_mc_people; + u_mc_people.real = this->mc_people; + *(outbuffer + offset + 0) = (u_mc_people.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->mc_people); + union { + bool real; + uint8_t base; + } u_mc_vehicles; + u_mc_vehicles.real = this->mc_vehicles; + *(outbuffer + offset + 0) = (u_mc_vehicles.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->mc_vehicles); + union { + bool real; + uint8_t base; + } u_mc_bag; + u_mc_bag.real = this->mc_bag; + *(outbuffer + offset + 0) = (u_mc_bag.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->mc_bag); + union { + bool real; + uint8_t base; + } u_mc_animal; + u_mc_animal.real = this->mc_animal; + *(outbuffer + offset + 0) = (u_mc_animal.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->mc_animal); + union { + bool real; + uint8_t base; + } u_mc_electronics; + u_mc_electronics.real = this->mc_electronics; + *(outbuffer + offset + 0) = (u_mc_electronics.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->mc_electronics); + union { + bool real; + uint8_t base; + } u_mc_fruit_vegetable; + u_mc_fruit_vegetable.real = this->mc_fruit_vegetable; + *(outbuffer + offset + 0) = (u_mc_fruit_vegetable.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->mc_fruit_vegetable); + union { + bool real; + uint8_t base; + } u_mc_sport; + u_mc_sport.real = this->mc_sport; + *(outbuffer + offset + 0) = (u_mc_sport.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->mc_sport); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + int8_t real; + uint8_t base; + } u_model; + u_model.base = 0; + u_model.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->model = u_model.real; + offset += sizeof(this->model); + union { + float real; + uint32_t base; + } u_confidence; + u_confidence.base = 0; + u_confidence.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_confidence.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_confidence.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_confidence.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->confidence = u_confidence.real; + offset += sizeof(this->confidence); + union { + float real; + uint32_t base; + } u_max_range; + u_max_range.base = 0; + u_max_range.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_max_range.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_max_range.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_max_range.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->max_range = u_max_range.real; + offset += sizeof(this->max_range); + union { + bool real; + uint8_t base; + } u_tracking; + u_tracking.base = 0; + u_tracking.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->tracking = u_tracking.real; + offset += sizeof(this->tracking); + union { + bool real; + uint8_t base; + } u_sk_body_fitting; + u_sk_body_fitting.base = 0; + u_sk_body_fitting.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->sk_body_fitting = u_sk_body_fitting.real; + offset += sizeof(this->sk_body_fitting); + union { + bool real; + uint8_t base; + } u_mc_people; + u_mc_people.base = 0; + u_mc_people.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->mc_people = u_mc_people.real; + offset += sizeof(this->mc_people); + union { + bool real; + uint8_t base; + } u_mc_vehicles; + u_mc_vehicles.base = 0; + u_mc_vehicles.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->mc_vehicles = u_mc_vehicles.real; + offset += sizeof(this->mc_vehicles); + union { + bool real; + uint8_t base; + } u_mc_bag; + u_mc_bag.base = 0; + u_mc_bag.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->mc_bag = u_mc_bag.real; + offset += sizeof(this->mc_bag); + union { + bool real; + uint8_t base; + } u_mc_animal; + u_mc_animal.base = 0; + u_mc_animal.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->mc_animal = u_mc_animal.real; + offset += sizeof(this->mc_animal); + union { + bool real; + uint8_t base; + } u_mc_electronics; + u_mc_electronics.base = 0; + u_mc_electronics.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->mc_electronics = u_mc_electronics.real; + offset += sizeof(this->mc_electronics); + union { + bool real; + uint8_t base; + } u_mc_fruit_vegetable; + u_mc_fruit_vegetable.base = 0; + u_mc_fruit_vegetable.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->mc_fruit_vegetable = u_mc_fruit_vegetable.real; + offset += sizeof(this->mc_fruit_vegetable); + union { + bool real; + uint8_t base; + } u_mc_sport; + u_mc_sport.base = 0; + u_mc_sport.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->mc_sport = u_mc_sport.real; + offset += sizeof(this->mc_sport); + return offset; + } + + virtual const char * getType() override { return START_OBJECT_DETECTION; }; + virtual const char * getMD5() override { return "237986910a8e55bd46f1c5ba0541a75b"; }; + + }; + + class start_object_detectionResponse : public ros::Msg + { + public: + typedef bool _done_type; + _done_type done; + + start_object_detectionResponse(): + done(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_done; + u_done.real = this->done; + *(outbuffer + offset + 0) = (u_done.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->done); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_done; + u_done.base = 0; + u_done.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->done = u_done.real; + offset += sizeof(this->done); + return offset; + } + + virtual const char * getType() override { return START_OBJECT_DETECTION; }; + virtual const char * getMD5() override { return "89bb254424e4cffedbf494e7b0ddbfea"; }; + + }; + + class start_object_detection { + public: + typedef start_object_detectionRequest Request; + typedef start_object_detectionResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/zed_interfaces/start_remote_stream.h b/pio_workspace/lib/ros_lib/zed_interfaces/start_remote_stream.h new file mode 100644 index 0000000..769c5ed --- /dev/null +++ b/pio_workspace/lib/ros_lib/zed_interfaces/start_remote_stream.h @@ -0,0 +1,110 @@ +#ifndef _ROS_SERVICE_start_remote_stream_h +#define _ROS_SERVICE_start_remote_stream_h +#include +#include +#include +#include "ros/msg.h" + +namespace zed_interfaces +{ + +static const char START_REMOTE_STREAM[] = "zed_interfaces/start_remote_stream"; + + class start_remote_streamRequest : public ros::Msg + { + public: + enum { codec = 0 }; + enum { port = 30000 }; + enum { bitrate = 2000 }; + enum { gop_size = -1 }; + enum { adaptative_bitrate = False }; + + start_remote_streamRequest() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + return offset; + } + + virtual const char * getType() override { return START_REMOTE_STREAM; }; + virtual const char * getMD5() override { return "a6f55a6077162992b395e1b483a03367"; }; + + }; + + class start_remote_streamResponse : public ros::Msg + { + public: + typedef bool _result_type; + _result_type result; + typedef const char* _info_type; + _info_type info; + + start_remote_streamResponse(): + result(0), + info("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_result; + u_result.real = this->result; + *(outbuffer + offset + 0) = (u_result.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->result); + uint32_t length_info = strlen(this->info); + varToArr(outbuffer + offset, length_info); + offset += 4; + memcpy(outbuffer + offset, this->info, length_info); + offset += length_info; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_result; + u_result.base = 0; + u_result.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->result = u_result.real; + offset += sizeof(this->result); + uint32_t length_info; + arrToVar(length_info, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_info; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_info-1]=0; + this->info = (char *)(inbuffer + offset-1); + offset += length_info; + return offset; + } + + virtual const char * getType() override { return START_REMOTE_STREAM; }; + virtual const char * getMD5() override { return "929b8c0d7b68510a3f501a60258c746e"; }; + + }; + + class start_remote_stream { + public: + typedef start_remote_streamRequest Request; + typedef start_remote_streamResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/zed_interfaces/start_svo_recording.h b/pio_workspace/lib/ros_lib/zed_interfaces/start_svo_recording.h new file mode 100644 index 0000000..2195d81 --- /dev/null +++ b/pio_workspace/lib/ros_lib/zed_interfaces/start_svo_recording.h @@ -0,0 +1,122 @@ +#ifndef _ROS_SERVICE_start_svo_recording_h +#define _ROS_SERVICE_start_svo_recording_h +#include +#include +#include +#include "ros/msg.h" + +namespace zed_interfaces +{ + +static const char START_SVO_RECORDING[] = "zed_interfaces/start_svo_recording"; + + class start_svo_recordingRequest : public ros::Msg + { + public: + typedef const char* _svo_filename_type; + _svo_filename_type svo_filename; + + start_svo_recordingRequest(): + svo_filename("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_svo_filename = strlen(this->svo_filename); + varToArr(outbuffer + offset, length_svo_filename); + offset += 4; + memcpy(outbuffer + offset, this->svo_filename, length_svo_filename); + offset += length_svo_filename; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_svo_filename; + arrToVar(length_svo_filename, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_svo_filename; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_svo_filename-1]=0; + this->svo_filename = (char *)(inbuffer + offset-1); + offset += length_svo_filename; + return offset; + } + + virtual const char * getType() override { return START_SVO_RECORDING; }; + virtual const char * getMD5() override { return "d53367c1321809b5cdba020b6f0085ff"; }; + + }; + + class start_svo_recordingResponse : public ros::Msg + { + public: + typedef bool _result_type; + _result_type result; + typedef const char* _info_type; + _info_type info; + + start_svo_recordingResponse(): + result(0), + info("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_result; + u_result.real = this->result; + *(outbuffer + offset + 0) = (u_result.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->result); + uint32_t length_info = strlen(this->info); + varToArr(outbuffer + offset, length_info); + offset += 4; + memcpy(outbuffer + offset, this->info, length_info); + offset += length_info; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_result; + u_result.base = 0; + u_result.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->result = u_result.real; + offset += sizeof(this->result); + uint32_t length_info; + arrToVar(length_info, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_info; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_info-1]=0; + this->info = (char *)(inbuffer + offset-1); + offset += length_info; + return offset; + } + + virtual const char * getType() override { return START_SVO_RECORDING; }; + virtual const char * getMD5() override { return "929b8c0d7b68510a3f501a60258c746e"; }; + + }; + + class start_svo_recording { + public: + typedef start_svo_recordingRequest Request; + typedef start_svo_recordingResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/zed_interfaces/stop_3d_mapping.h b/pio_workspace/lib/ros_lib/zed_interfaces/stop_3d_mapping.h new file mode 100644 index 0000000..fe1fd6d --- /dev/null +++ b/pio_workspace/lib/ros_lib/zed_interfaces/stop_3d_mapping.h @@ -0,0 +1,88 @@ +#ifndef _ROS_SERVICE_stop_3d_mapping_h +#define _ROS_SERVICE_stop_3d_mapping_h +#include +#include +#include +#include "ros/msg.h" + +namespace zed_interfaces +{ + +static const char STOP_3D_MAPPING[] = "zed_interfaces/stop_3d_mapping"; + + class stop_3d_mappingRequest : public ros::Msg + { + public: + + stop_3d_mappingRequest() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + return offset; + } + + virtual const char * getType() override { return STOP_3D_MAPPING; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class stop_3d_mappingResponse : public ros::Msg + { + public: + typedef bool _done_type; + _done_type done; + + stop_3d_mappingResponse(): + done(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_done; + u_done.real = this->done; + *(outbuffer + offset + 0) = (u_done.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->done); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_done; + u_done.base = 0; + u_done.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->done = u_done.real; + offset += sizeof(this->done); + return offset; + } + + virtual const char * getType() override { return STOP_3D_MAPPING; }; + virtual const char * getMD5() override { return "89bb254424e4cffedbf494e7b0ddbfea"; }; + + }; + + class stop_3d_mapping { + public: + typedef stop_3d_mappingRequest Request; + typedef stop_3d_mappingResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/zed_interfaces/stop_object_detection.h b/pio_workspace/lib/ros_lib/zed_interfaces/stop_object_detection.h new file mode 100644 index 0000000..8e23cca --- /dev/null +++ b/pio_workspace/lib/ros_lib/zed_interfaces/stop_object_detection.h @@ -0,0 +1,88 @@ +#ifndef _ROS_SERVICE_stop_object_detection_h +#define _ROS_SERVICE_stop_object_detection_h +#include +#include +#include +#include "ros/msg.h" + +namespace zed_interfaces +{ + +static const char STOP_OBJECT_DETECTION[] = "zed_interfaces/stop_object_detection"; + + class stop_object_detectionRequest : public ros::Msg + { + public: + + stop_object_detectionRequest() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + return offset; + } + + virtual const char * getType() override { return STOP_OBJECT_DETECTION; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class stop_object_detectionResponse : public ros::Msg + { + public: + typedef bool _done_type; + _done_type done; + + stop_object_detectionResponse(): + done(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_done; + u_done.real = this->done; + *(outbuffer + offset + 0) = (u_done.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->done); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_done; + u_done.base = 0; + u_done.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->done = u_done.real; + offset += sizeof(this->done); + return offset; + } + + virtual const char * getType() override { return STOP_OBJECT_DETECTION; }; + virtual const char * getMD5() override { return "89bb254424e4cffedbf494e7b0ddbfea"; }; + + }; + + class stop_object_detection { + public: + typedef stop_object_detectionRequest Request; + typedef stop_object_detectionResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/zed_interfaces/stop_remote_stream.h b/pio_workspace/lib/ros_lib/zed_interfaces/stop_remote_stream.h new file mode 100644 index 0000000..89fc944 --- /dev/null +++ b/pio_workspace/lib/ros_lib/zed_interfaces/stop_remote_stream.h @@ -0,0 +1,88 @@ +#ifndef _ROS_SERVICE_stop_remote_stream_h +#define _ROS_SERVICE_stop_remote_stream_h +#include +#include +#include +#include "ros/msg.h" + +namespace zed_interfaces +{ + +static const char STOP_REMOTE_STREAM[] = "zed_interfaces/stop_remote_stream"; + + class stop_remote_streamRequest : public ros::Msg + { + public: + + stop_remote_streamRequest() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + return offset; + } + + virtual const char * getType() override { return STOP_REMOTE_STREAM; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class stop_remote_streamResponse : public ros::Msg + { + public: + typedef bool _done_type; + _done_type done; + + stop_remote_streamResponse(): + done(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_done; + u_done.real = this->done; + *(outbuffer + offset + 0) = (u_done.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->done); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_done; + u_done.base = 0; + u_done.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->done = u_done.real; + offset += sizeof(this->done); + return offset; + } + + virtual const char * getType() override { return STOP_REMOTE_STREAM; }; + virtual const char * getMD5() override { return "89bb254424e4cffedbf494e7b0ddbfea"; }; + + }; + + class stop_remote_stream { + public: + typedef stop_remote_streamRequest Request; + typedef stop_remote_streamResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/zed_interfaces/stop_svo_recording.h b/pio_workspace/lib/ros_lib/zed_interfaces/stop_svo_recording.h new file mode 100644 index 0000000..c02e83a --- /dev/null +++ b/pio_workspace/lib/ros_lib/zed_interfaces/stop_svo_recording.h @@ -0,0 +1,105 @@ +#ifndef _ROS_SERVICE_stop_svo_recording_h +#define _ROS_SERVICE_stop_svo_recording_h +#include +#include +#include +#include "ros/msg.h" + +namespace zed_interfaces +{ + +static const char STOP_SVO_RECORDING[] = "zed_interfaces/stop_svo_recording"; + + class stop_svo_recordingRequest : public ros::Msg + { + public: + + stop_svo_recordingRequest() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + return offset; + } + + virtual const char * getType() override { return STOP_SVO_RECORDING; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class stop_svo_recordingResponse : public ros::Msg + { + public: + typedef bool _done_type; + _done_type done; + typedef const char* _info_type; + _info_type info; + + stop_svo_recordingResponse(): + done(0), + info("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_done; + u_done.real = this->done; + *(outbuffer + offset + 0) = (u_done.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->done); + uint32_t length_info = strlen(this->info); + varToArr(outbuffer + offset, length_info); + offset += 4; + memcpy(outbuffer + offset, this->info, length_info); + offset += length_info; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_done; + u_done.base = 0; + u_done.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->done = u_done.real; + offset += sizeof(this->done); + uint32_t length_info; + arrToVar(length_info, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_info; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_info-1]=0; + this->info = (char *)(inbuffer + offset-1); + offset += length_info; + return offset; + } + + virtual const char * getType() override { return STOP_SVO_RECORDING; }; + virtual const char * getMD5() override { return "784b6c45ec0bd93cee43c7cd15145736"; }; + + }; + + class stop_svo_recording { + public: + typedef stop_svo_recordingRequest Request; + typedef stop_svo_recordingResponse Response; + }; + +} +#endif diff --git a/pio_workspace/lib/ros_lib/zed_interfaces/toggle_led.h b/pio_workspace/lib/ros_lib/zed_interfaces/toggle_led.h new file mode 100644 index 0000000..ff01762 --- /dev/null +++ b/pio_workspace/lib/ros_lib/zed_interfaces/toggle_led.h @@ -0,0 +1,88 @@ +#ifndef _ROS_SERVICE_toggle_led_h +#define _ROS_SERVICE_toggle_led_h +#include +#include +#include +#include "ros/msg.h" + +namespace zed_interfaces +{ + +static const char TOGGLE_LED[] = "zed_interfaces/toggle_led"; + + class toggle_ledRequest : public ros::Msg + { + public: + + toggle_ledRequest() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + return offset; + } + + virtual const char * getType() override { return TOGGLE_LED; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class toggle_ledResponse : public ros::Msg + { + public: + typedef bool _new_led_status_type; + _new_led_status_type new_led_status; + + toggle_ledResponse(): + new_led_status(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_new_led_status; + u_new_led_status.real = this->new_led_status; + *(outbuffer + offset + 0) = (u_new_led_status.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->new_led_status); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_new_led_status; + u_new_led_status.base = 0; + u_new_led_status.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->new_led_status = u_new_led_status.real; + offset += sizeof(this->new_led_status); + return offset; + } + + virtual const char * getType() override { return TOGGLE_LED; }; + virtual const char * getMD5() override { return "866beb482157f32341c9f0eac54a1e38"; }; + + }; + + class toggle_led { + public: + typedef toggle_ledRequest Request; + typedef toggle_ledResponse Response; + }; + +} +#endif From 89d6e25e490a4e0ba6f423b309d06c91290d2bf0 Mon Sep 17 00:00:00 2001 From: veronika Date: Sat, 18 Oct 2025 14:10:10 -0400 Subject: [PATCH 2/3] Second sync of custom messages --- .../lib/ros_lib/auv_msgs/UnityState.h | 146 +++++++++--------- .../lib/ros_lib/gazebo_msgs/ApplyBodyWrench.h | 4 +- .../ros_lib/gazebo_msgs/ApplyJointEffort.h | 2 +- .../lib/ros_lib/gazebo_msgs/GetModelState.h | 2 +- .../gazebo_msgs/GetPhysicsProperties.h | 2 +- .../ros_lib/gazebo_msgs/SetJointTrajectory.h | 2 +- .../ros_lib/gazebo_msgs/SetLightProperties.h | 2 +- .../gazebo_msgs/SetPhysicsProperties.h | 2 +- .../lib/ros_lib/geographic_msgs/GetGeoPath.h | 2 +- .../geographic_msgs/GetGeographicMap.h | 2 +- pio_workspace/lib/ros_lib/nav_msgs/GetPlan.h | 2 +- 11 files changed, 84 insertions(+), 84 deletions(-) diff --git a/pio_workspace/lib/ros_lib/auv_msgs/UnityState.h b/pio_workspace/lib/ros_lib/auv_msgs/UnityState.h index c27021f..2be79b3 100644 --- a/pio_workspace/lib/ros_lib/auv_msgs/UnityState.h +++ b/pio_workspace/lib/ros_lib/auv_msgs/UnityState.h @@ -44,14 +44,14 @@ namespace auv_msgs typedef uint32_t _hydrophone_four_freqs_type; _hydrophone_four_freqs_type st_hydrophone_four_freqs; _hydrophone_four_freqs_type * hydrophone_four_freqs; - typedef int32_t _isDVLActive_type; - _isDVLActive_type isDVLActive; - typedef int32_t _isDepthSensorActive_type; - _isDepthSensorActive_type isDepthSensorActive; - typedef int32_t _isIMUActive_type; - _isIMUActive_type isIMUActive; - typedef int32_t _isHydrophonesActive_type; - _isHydrophonesActive_type isHydrophonesActive; + typedef int32_t _is_dvl_active_type; + _is_dvl_active_type is_dvl_active; + typedef int32_t _is_depth_sensor_active_type; + _is_depth_sensor_active_type is_depth_sensor_active; + typedef int32_t _is_imu_active_type; + _is_imu_active_type is_imu_active; + typedef int32_t _is_hydrophones_active_type; + _is_hydrophones_active_type is_hydrophones_active; UnityState(): position(), @@ -64,10 +64,10 @@ namespace auv_msgs hydrophone_two_freqs_length(0), st_hydrophone_two_freqs(), hydrophone_two_freqs(nullptr), hydrophone_three_freqs_length(0), st_hydrophone_three_freqs(), hydrophone_three_freqs(nullptr), hydrophone_four_freqs_length(0), st_hydrophone_four_freqs(), hydrophone_four_freqs(nullptr), - isDVLActive(0), - isDepthSensorActive(0), - isIMUActive(0), - isHydrophonesActive(0) + is_dvl_active(0), + is_depth_sensor_active(0), + is_imu_active(0), + is_hydrophones_active(0) { } @@ -147,43 +147,43 @@ namespace auv_msgs union { int32_t real; uint32_t base; - } u_isDVLActive; - u_isDVLActive.real = this->isDVLActive; - *(outbuffer + offset + 0) = (u_isDVLActive.base >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (u_isDVLActive.base >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (u_isDVLActive.base >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (u_isDVLActive.base >> (8 * 3)) & 0xFF; - offset += sizeof(this->isDVLActive); + } u_is_dvl_active; + u_is_dvl_active.real = this->is_dvl_active; + *(outbuffer + offset + 0) = (u_is_dvl_active.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_is_dvl_active.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_is_dvl_active.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_is_dvl_active.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->is_dvl_active); union { int32_t real; uint32_t base; - } u_isDepthSensorActive; - u_isDepthSensorActive.real = this->isDepthSensorActive; - *(outbuffer + offset + 0) = (u_isDepthSensorActive.base >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (u_isDepthSensorActive.base >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (u_isDepthSensorActive.base >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (u_isDepthSensorActive.base >> (8 * 3)) & 0xFF; - offset += sizeof(this->isDepthSensorActive); + } u_is_depth_sensor_active; + u_is_depth_sensor_active.real = this->is_depth_sensor_active; + *(outbuffer + offset + 0) = (u_is_depth_sensor_active.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_is_depth_sensor_active.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_is_depth_sensor_active.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_is_depth_sensor_active.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->is_depth_sensor_active); union { int32_t real; uint32_t base; - } u_isIMUActive; - u_isIMUActive.real = this->isIMUActive; - *(outbuffer + offset + 0) = (u_isIMUActive.base >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (u_isIMUActive.base >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (u_isIMUActive.base >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (u_isIMUActive.base >> (8 * 3)) & 0xFF; - offset += sizeof(this->isIMUActive); + } u_is_imu_active; + u_is_imu_active.real = this->is_imu_active; + *(outbuffer + offset + 0) = (u_is_imu_active.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_is_imu_active.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_is_imu_active.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_is_imu_active.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->is_imu_active); union { int32_t real; uint32_t base; - } u_isHydrophonesActive; - u_isHydrophonesActive.real = this->isHydrophonesActive; - *(outbuffer + offset + 0) = (u_isHydrophonesActive.base >> (8 * 0)) & 0xFF; - *(outbuffer + offset + 1) = (u_isHydrophonesActive.base >> (8 * 1)) & 0xFF; - *(outbuffer + offset + 2) = (u_isHydrophonesActive.base >> (8 * 2)) & 0xFF; - *(outbuffer + offset + 3) = (u_isHydrophonesActive.base >> (8 * 3)) & 0xFF; - offset += sizeof(this->isHydrophonesActive); + } u_is_hydrophones_active; + u_is_hydrophones_active.real = this->is_hydrophones_active; + *(outbuffer + offset + 0) = (u_is_hydrophones_active.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_is_hydrophones_active.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_is_hydrophones_active.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_is_hydrophones_active.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->is_hydrophones_active); return offset; } @@ -284,52 +284,52 @@ namespace auv_msgs union { int32_t real; uint32_t base; - } u_isDVLActive; - u_isDVLActive.base = 0; - u_isDVLActive.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); - u_isDVLActive.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - u_isDVLActive.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - u_isDVLActive.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - this->isDVLActive = u_isDVLActive.real; - offset += sizeof(this->isDVLActive); + } u_is_dvl_active; + u_is_dvl_active.base = 0; + u_is_dvl_active.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_is_dvl_active.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_is_dvl_active.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_is_dvl_active.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->is_dvl_active = u_is_dvl_active.real; + offset += sizeof(this->is_dvl_active); union { int32_t real; uint32_t base; - } u_isDepthSensorActive; - u_isDepthSensorActive.base = 0; - u_isDepthSensorActive.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); - u_isDepthSensorActive.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - u_isDepthSensorActive.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - u_isDepthSensorActive.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - this->isDepthSensorActive = u_isDepthSensorActive.real; - offset += sizeof(this->isDepthSensorActive); + } u_is_depth_sensor_active; + u_is_depth_sensor_active.base = 0; + u_is_depth_sensor_active.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_is_depth_sensor_active.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_is_depth_sensor_active.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_is_depth_sensor_active.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->is_depth_sensor_active = u_is_depth_sensor_active.real; + offset += sizeof(this->is_depth_sensor_active); union { int32_t real; uint32_t base; - } u_isIMUActive; - u_isIMUActive.base = 0; - u_isIMUActive.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); - u_isIMUActive.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - u_isIMUActive.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - u_isIMUActive.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - this->isIMUActive = u_isIMUActive.real; - offset += sizeof(this->isIMUActive); + } u_is_imu_active; + u_is_imu_active.base = 0; + u_is_imu_active.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_is_imu_active.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_is_imu_active.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_is_imu_active.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->is_imu_active = u_is_imu_active.real; + offset += sizeof(this->is_imu_active); union { int32_t real; uint32_t base; - } u_isHydrophonesActive; - u_isHydrophonesActive.base = 0; - u_isHydrophonesActive.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); - u_isHydrophonesActive.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); - u_isHydrophonesActive.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); - u_isHydrophonesActive.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); - this->isHydrophonesActive = u_isHydrophonesActive.real; - offset += sizeof(this->isHydrophonesActive); + } u_is_hydrophones_active; + u_is_hydrophones_active.base = 0; + u_is_hydrophones_active.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_is_hydrophones_active.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_is_hydrophones_active.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_is_hydrophones_active.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->is_hydrophones_active = u_is_hydrophones_active.real; + offset += sizeof(this->is_hydrophones_active); return offset; } virtual const char * getType() override { return "auv_msgs/UnityState"; }; - virtual const char * getMD5() override { return "deac3cf7620639c22bbe228fb39d2aa6"; }; + virtual const char * getMD5() override { return "6690d8ec41fe154591da2cf6b44a9f06"; }; }; diff --git a/pio_workspace/lib/ros_lib/gazebo_msgs/ApplyBodyWrench.h b/pio_workspace/lib/ros_lib/gazebo_msgs/ApplyBodyWrench.h index 54e8550..5a6d112 100644 --- a/pio_workspace/lib/ros_lib/gazebo_msgs/ApplyBodyWrench.h +++ b/pio_workspace/lib/ros_lib/gazebo_msgs/ApplyBodyWrench.h @@ -4,10 +4,10 @@ #include #include #include "ros/msg.h" -#include "ros/time.h" +#include "ros/duration.h" #include "geometry_msgs/Point.h" #include "geometry_msgs/Wrench.h" -#include "ros/duration.h" +#include "ros/time.h" namespace gazebo_msgs { diff --git a/pio_workspace/lib/ros_lib/gazebo_msgs/ApplyJointEffort.h b/pio_workspace/lib/ros_lib/gazebo_msgs/ApplyJointEffort.h index e51d34d..c33709d 100644 --- a/pio_workspace/lib/ros_lib/gazebo_msgs/ApplyJointEffort.h +++ b/pio_workspace/lib/ros_lib/gazebo_msgs/ApplyJointEffort.h @@ -4,8 +4,8 @@ #include #include #include "ros/msg.h" -#include "ros/time.h" #include "ros/duration.h" +#include "ros/time.h" namespace gazebo_msgs { diff --git a/pio_workspace/lib/ros_lib/gazebo_msgs/GetModelState.h b/pio_workspace/lib/ros_lib/gazebo_msgs/GetModelState.h index ba16528..d572ad5 100644 --- a/pio_workspace/lib/ros_lib/gazebo_msgs/GetModelState.h +++ b/pio_workspace/lib/ros_lib/gazebo_msgs/GetModelState.h @@ -4,9 +4,9 @@ #include #include #include "ros/msg.h" -#include "geometry_msgs/Twist.h" #include "geometry_msgs/Pose.h" #include "std_msgs/Header.h" +#include "geometry_msgs/Twist.h" namespace gazebo_msgs { diff --git a/pio_workspace/lib/ros_lib/gazebo_msgs/GetPhysicsProperties.h b/pio_workspace/lib/ros_lib/gazebo_msgs/GetPhysicsProperties.h index e3428aa..03fe7dc 100644 --- a/pio_workspace/lib/ros_lib/gazebo_msgs/GetPhysicsProperties.h +++ b/pio_workspace/lib/ros_lib/gazebo_msgs/GetPhysicsProperties.h @@ -4,8 +4,8 @@ #include #include #include "ros/msg.h" -#include "gazebo_msgs/ODEPhysics.h" #include "geometry_msgs/Vector3.h" +#include "gazebo_msgs/ODEPhysics.h" namespace gazebo_msgs { diff --git a/pio_workspace/lib/ros_lib/gazebo_msgs/SetJointTrajectory.h b/pio_workspace/lib/ros_lib/gazebo_msgs/SetJointTrajectory.h index 95ee7be..88cb34f 100644 --- a/pio_workspace/lib/ros_lib/gazebo_msgs/SetJointTrajectory.h +++ b/pio_workspace/lib/ros_lib/gazebo_msgs/SetJointTrajectory.h @@ -4,8 +4,8 @@ #include #include #include "ros/msg.h" -#include "geometry_msgs/Pose.h" #include "trajectory_msgs/JointTrajectory.h" +#include "geometry_msgs/Pose.h" namespace gazebo_msgs { diff --git a/pio_workspace/lib/ros_lib/gazebo_msgs/SetLightProperties.h b/pio_workspace/lib/ros_lib/gazebo_msgs/SetLightProperties.h index 82da145..ca58e62 100644 --- a/pio_workspace/lib/ros_lib/gazebo_msgs/SetLightProperties.h +++ b/pio_workspace/lib/ros_lib/gazebo_msgs/SetLightProperties.h @@ -4,8 +4,8 @@ #include #include #include "ros/msg.h" -#include "geometry_msgs/Pose.h" #include "geometry_msgs/Vector3.h" +#include "geometry_msgs/Pose.h" #include "std_msgs/ColorRGBA.h" namespace gazebo_msgs diff --git a/pio_workspace/lib/ros_lib/gazebo_msgs/SetPhysicsProperties.h b/pio_workspace/lib/ros_lib/gazebo_msgs/SetPhysicsProperties.h index bb25bf8..f2c3177 100644 --- a/pio_workspace/lib/ros_lib/gazebo_msgs/SetPhysicsProperties.h +++ b/pio_workspace/lib/ros_lib/gazebo_msgs/SetPhysicsProperties.h @@ -4,8 +4,8 @@ #include #include #include "ros/msg.h" -#include "gazebo_msgs/ODEPhysics.h" #include "geometry_msgs/Vector3.h" +#include "gazebo_msgs/ODEPhysics.h" namespace gazebo_msgs { diff --git a/pio_workspace/lib/ros_lib/geographic_msgs/GetGeoPath.h b/pio_workspace/lib/ros_lib/geographic_msgs/GetGeoPath.h index 272a2ea..6ddee54 100644 --- a/pio_workspace/lib/ros_lib/geographic_msgs/GetGeoPath.h +++ b/pio_workspace/lib/ros_lib/geographic_msgs/GetGeoPath.h @@ -4,8 +4,8 @@ #include #include #include "ros/msg.h" -#include "geographic_msgs/GeoPoint.h" #include "geographic_msgs/GeoPath.h" +#include "geographic_msgs/GeoPoint.h" #include "uuid_msgs/UniqueID.h" namespace geographic_msgs diff --git a/pio_workspace/lib/ros_lib/geographic_msgs/GetGeographicMap.h b/pio_workspace/lib/ros_lib/geographic_msgs/GetGeographicMap.h index ccb1587..600ee5c 100644 --- a/pio_workspace/lib/ros_lib/geographic_msgs/GetGeographicMap.h +++ b/pio_workspace/lib/ros_lib/geographic_msgs/GetGeographicMap.h @@ -4,8 +4,8 @@ #include #include #include "ros/msg.h" -#include "geographic_msgs/BoundingBox.h" #include "geographic_msgs/GeographicMap.h" +#include "geographic_msgs/BoundingBox.h" namespace geographic_msgs { diff --git a/pio_workspace/lib/ros_lib/nav_msgs/GetPlan.h b/pio_workspace/lib/ros_lib/nav_msgs/GetPlan.h index def1793..7a15207 100644 --- a/pio_workspace/lib/ros_lib/nav_msgs/GetPlan.h +++ b/pio_workspace/lib/ros_lib/nav_msgs/GetPlan.h @@ -4,8 +4,8 @@ #include #include #include "ros/msg.h" -#include "nav_msgs/Path.h" #include "geometry_msgs/PoseStamped.h" +#include "nav_msgs/Path.h" namespace nav_msgs { From c2ee8217bb131244367707cff8a571b4fefe5275 Mon Sep 17 00:00:00 2001 From: Yau Chau Date: Sat, 1 Nov 2025 17:07:06 -0400 Subject: [PATCH 3/3] Rearrange thruster pin definitions Signed-off-by: Yau Chau --- pio_workspace/src/power_ros1_main.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pio_workspace/src/power_ros1_main.cpp b/pio_workspace/src/power_ros1_main.cpp index 1cb9ccd..d2d921a 100644 --- a/pio_workspace/src/power_ros1_main.cpp +++ b/pio_workspace/src/power_ros1_main.cpp @@ -24,14 +24,14 @@ SETUP FOR ROS COMMUNICATION WITH THE POWER BOARD #include // defines thruster pins -#define BACK_L_PIN 2 -#define HEAVE_BACK_L_PIN 3 -#define HEAVE_FRONT_L_PIN 4 -#define FRONT_L_PIN 5 -#define FRONT_R_PIN 6 -#define HEAVE_FRONT_R_PIN 7 -#define HEAVE_BACK_R_PIN 8 -#define BACK_R_PIN 9 +#define BACK_L_PIN 9 +#define HEAVE_BACK_L_PIN 8 +#define HEAVE_FRONT_L_PIN 7 +#define FRONT_L_PIN 6 +#define FRONT_R_PIN 5 +#define HEAVE_FRONT_R_PIN 4 +#define HEAVE_BACK_R_PIN 3 +#define BACK_R_PIN 2 #define LED_PIN 13